[R] Vuong test
Marc Schwartz
marc_schwartz at me.com
Fri Jul 13 14:36:26 CEST 2012
On Jul 13, 2012, at 12:35 AM, sanchez ana wrote:
> Dear All,
>
> I am using the function vuong from pscl package to compare 2 non nested models NB1
> (negative binomial I ) and Zero-inflated model.
>
>
> NB1 <- glm(, , family = quasipoisson), it is an
> object of class: "glm" "lm"
> zinb <-
> zeroinfl( dist = "negbin") is an object of class: "zeroinfl"
>
> when applying vuong
> function I get the following:
> vuong(NB1, zinb)
> Error en predprob.glm(m1) :
> your object of class glm is unsupported by
> predprob.glmyour object of class lm is unsupported by predprob.glm
>
>
> Any help will be really appreciated.
Either you did not properly copy your code above or something is amiss in your understanding.
NB1 is NOT a negative binomial model, but is a quasipoisson model. The latter is not fit using maximum likelihood, hence the Vuong test, which is a likelihood ratio based test, fails.
If you want a negative binomial model, you should be using glm.nb() in V&R's MASS package:
require(MASS)
NB1 <- glm.nb(...)
Then you can use the Vuong test from pscl.
If you have not, you might want to read:
vignette("countreg")
Regards,
Marc Schwartz
More information about the R-help
mailing list