[R] Res: Using the zero-inflated binomial in experimental designs

Ben Bolker bolker at ufl.edu
Tue May 18 22:42:42 CEST 2010


Ivan Allaman <ivanalaman <at> yahoo.com.br> writes:

> 
> 
> Hi Ben!
> 
> First I thank you for your attention. Unfortunately, the ANOVA does not work
with vglm. In
> another email, Rafael warned me that actually a lot of zeros does not
> necessarily imply a distribution of zeros binomail inflated. So how could I
test if my variable is or not a
> binomial zero inflated?

   For most modeling functions in R, anova() actually performs a
likelihood ratio test [its name is a historical accident/extension
from the linear models case].  If VGLM has a logLik() accessor method
you can do your own LRT as follows:

pchisq(-2*(logLik(fullModel)-logLik(reducedModel)),lower.tail=FALSE,
    df=[difference in number of parameters])

if there is no logLik() accessor you can just read off the values
from the summary, or use str() to figure out how to extract the value
from the model fit.

To test whether zero-inflation is necessary you can compare the log-likelihood
of the zero-inflated model vs. the log-likelihood of a non-zero-inflated
model, with a couple of caveats: (1) check to make sure that the
different functions you are using [e.g. if you use glm() for non-inflated
and vglm() for inflated models] are including/excluding the same additive
constants from the log-likelihood; (2) the p-value may be somewhat 
conservative, if the null hypothesis (no zero-inflation) is on the
boundary of the feasible space of the parameter [e.g.see p. 330 of
http://people.biology.ufl.edu/bolker/emdbook/book.pdf ]

More easily but less specifically, you could see whether the binomial
model appears to be an adequate fit to the data, graphically (by
comparing observed vs expected frequencies of zeros) or by doing a
chi-squared test.



More information about the R-help mailing list