zitest | R Documentation |
Tests the null hypothesis of a Poisson GLM against the alternative of a zero-inflated version.
zitest(object, type = c("scoreZIP"))
object |
a fitted Poisson GLM of class |
type |
type of test, currently only |
Currently alternative contains only intercept term in binary part, as in van den Broek (1995).
Note that under the null hypothesis the parameter is on the boundary of the parameter space, hence the p-value is non-standard.
An object of class "htest"
.
van den Broek J (1995). “A Score Test for Zero Inflation in a Poisson Distribution”. Biometrics, 51, 738–743.
glm
, poisson
, glm.nb
data("CrabSatellites", package = "countreg")
CrabSatellites <- transform(CrabSatellites,
color = as.numeric(color),
spine = as.numeric(spine),
cwidth = cut(width, c(-Inf, seq(23.25, 29.25), Inf))
)
cs_p <- glm(satellites ~ width + color, data = CrabSatellites, family = poisson)
zitest(cs_p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.