Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

2 of 5
added 11 characters in body
r2evans
  • 167.7k
  • 8
  • 92
  • 176

Error "could not find function 'dposnegbin2'" when using posnegbinomial() in vglm() from VGAM

I'm trying to fit a zero-truncated negative binomial model using the vglm() function from the VGAM package in R. However, I'm encountering the following error:

> library(VGAM)
> m1 <- vglm(stay ~ age + hmo + died, family = posnegbinomial(), data = dat)
Error in dposnegbin2(y, kmat, munb = munb, log = TRUE) : 
 could not find function "dposnegbin2"

I’ve confirmed that the VGAM package is loaded, but the error suggests an internal function dposnegbin2() is not available.

Has anyone else encountered this issue? Is there a known fix? I'm also open to alternative ways to fit a positive or zero-truncated negative binomial model in R.

Any help would be appreciated!

Ariel
  • 11
  • 2
lang-r

AltStyle によって変換されたページ (->オリジナル) /