zitest: Zero Inflation Tests

View source: R/zitest.R

zitestR Documentation

Zero Inflation Tests

Description

Tests the null hypothesis of a Poisson GLM against the alternative of a zero-inflated version.

Usage

zitest(object, type = c("scoreZIP"))

Arguments

object

a fitted Poisson GLM of class "glm" as fitted by glm with family poisson.

type

type of test, currently only scoreZIP. See details.

Details

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.

Value

An object of class "htest".

References

van den Broek J (1995). “A Score Test for Zero Inflation in a Poisson Distribution”. Biometrics, 51, 738–743.

See Also

glm, poisson, glm.nb

Examples

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)


countreg documentation built on Dec. 4, 2023, 3:09 a.m.