Learn R Programming

pscl (version 0.5)

zeroinfl: Zero-inflated regression models for count data

Description

Fit zero-inflated regression models for count data via maximum likelihood

Usage

zeroinfl(count = y ~ ., x = ~1, z = ~1, data = list(), link = "logit",
        dist = "poisson", method = "BFGS", trace = FALSE,
        maxit = 50000, na.action = na.omit)

Arguments

count
count being modeled, passed as the left-hand side of a formula; lowest count must be zero for zero-inflated models
x
right-hand side of a formula giving covariates for the count part of the model
z
right-hand side of a formula giving covariates for the zero-inflated part of the model
data
a data frame
link
link function for zero-inflated part of the model (choices are logit (default) or probit)
dist
type of count model, "poisson" (default) or "negbin"
method
method for maximizing the log-likelihood function, only "BFGS" and "Nelder-Mead" are supported
trace
logical, if TRUE, display progress of maximization
maxit
maximum number of iterations in maximization
na.action
method for handling missing data, default is na.omit

Value

  • an object of class zeroinfl, i.e., a list with components including
  • stvalstart values used in optimzation
  • parMaximum likelihood estimates
  • hessianMatrix of second derivatives of the log-likelihood function evaluated at the MLEs; computed numerically by optim
  • llhvalue of the log-likelihood function at the MLEs
  • yvector of counts actually fitted (after any screeing of missing data)
  • xmatrix of covariates used in fitting the count model
  • zmatrix of covariates used in fitting the zero-inflated component

Details

Zero-inflated count models are a type of two-component mixture model, with a component for zero counts, and the other component for the positive counts. Poisson or negative-binomial models are used for the count component of the model; logit or probit is typically used to model the probability of a zero-count. optim is used to find maximum likelihood estimates and to compute a Hessian matrix after convergence.

References

Lambert, Diane. 1992. "Zero-Inflated Poisson Regression, With an Application to Defects in Manufacturing." Technometrics.V34(1):1-14

Cameron, A. Colin and Pravin K. Trevedi. 1998. Regression analysis of count data. New York: Cambridge University Press.

Long, J. Scott. 1997. Regression Models for Categorical and Limited Dependent Variables. Number 7 in Advanced Quantitative Techniques in the Social Sciences. Thousand Oaks, California: Sage.

See Also

summary.zeroinfl, predict.zeroinfl, hurdle, glm.nb

Methods are supplied for the generic functions coef and logLik, for objects of class "zeroinfl".

Examples

Run this code
data(bioChemists)
zip <- zeroinfl(count=art ~ .,
                x = ~ fem + mar + kid5 + phd + ment,
                z = ~ fem + mar + kid5 + phd + ment,
                data=bioChemists,trace=TRUE)
summary(zip)

zinb <- zeroinfl(count=art ~ .,
                 x = ~ fem + mar + kid5 + phd + ment,
                 z = ~ fem + mar + kid5 + phd + ment,
                 dist="negbin",
                 data=bioChemists,trace=TRUE)
summary(zinb)

Run the code above in your browser using DataLab