"zeroinfl".## S3 method for class 'zeroinfl':
predict(object, newdata,
type = c("response", "prob", "count", "zero"), na.action = na.pass, ...)
## S3 method for class 'zeroinfl':
residuals(object, type = c("pearson", "response"), ...)## S3 method for class 'zeroinfl':
coef(object, model = c("full", "count", "zero"), ...)
## S3 method for class 'zeroinfl':
vcov(object, model = c("full", "count", "zero"), ...)
## S3 method for class 'zeroinfl':
terms(x, model = c("count", "zero"), ...)
## S3 method for class 'zeroinfl':
model.matrix(object, model = c("count", "zero"), ...)
"zeroinfl" as returned by
zeroinfl.newdata. The default is to predict NA."zeroinfl", including methods to the generic functions
print and summary which print the estimated
coefficients along with some further information. The summary in particular
supplies partial Wald tests based on the coefficients and the covariance matrix
(estimated from the Hessian in the numerical optimization of the log-likelihood).
As usual, the summary method returns an object of class "summary.zeroinfl"
containing the relevant summary statistics which can subsequently be printed
using the associated print method.
The methods for coef and vcov by default
return a single vector of coefficients and their associated covariance matrix,
respectively, i.e., all coefficients are concatenated. By setting the model
argument, the estimates for the corresponding model components can be extracted.
Both the fitted and predict methods can
compute fitted responses. The latter additionally provides the predicted density
(i.e., probabilities for the observed counts), the predicted mean from the count
component (without zero inflation) and the predicted probability for the zero
component. The residuals method can compute
raw residuals (observed - fitted) and Pearson residuals (raw residuals scaled by
square root of variance function).
The terms and model.matrix extractors can
be used to extract the relevant information for either component of the model. A logLik method is provided, hence AIC
can be called to compute information criteria.
zeroinfldata("bioChemists", package = "pscl")
fm_zip <- zeroinfl(art ~ ., data = bioChemists)
plot(residuals(fm_zip) ~ fitted(fm_zip))
coef(fm_zip)
coef(fm_zip, model = "count")
summary(fm_zip)
logLik(fm_zip)Run the code above in your browser using DataLab