Skip to content
Prev 221291 / 398500 Next

Res: Using the zero-inflated binomial in experimental designs

Ivan Allaman <ivanalaman <at> yahoo.com.br> writes:
with vglm. In
test if my variable is or not a
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.