"zipath".## S3 method for class 'zipath':
predict(object, newdata, which = 1:object$nlambda,
type = c("response", "prob", "count", "zero", "nonzero"), na.action = na.pass,
at = NULL, ...)
## S3 method for class 'zipath':
residuals(object, type = c("pearson", "response"), ...)## S3 method for class 'zipath':
coef(object, which=1:object$nlambda, model = c("full", "count", "zero"), ...)
## S3 method for class 'zipath':
terms(x, model = c("count", "zero"), ...)
## S3 method for class 'zipath':
model.matrix(object, model = c("count", "zero"), ...)
"zipath" as returned by
zipath.lambda at which
predictions are required. By default, all indices are returned.newdata. The default is to predict NA.type = "prob", a numeric vector at which
the probabilities are evaluated. By default 0:max(y) is used
where y is the original observed response."zipath", including methods to the generic functions
print and summary which print the estimated
coefficients along with some further information.
As usual, the summary method returns an object of class "summary.zipath"
containing the relevant summary statistics which can subsequently be printed
using the associated print method.
The methods for coef 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).Zhu Wang, Shuangge Ma, Ching-Yun Wang, Michael Zappitelli, Prasad Devarajan and Chirag R. Parikh (2014) EM for Regularized Zero Inflated Regression Models with Applications to Postoperative Morbidity after Cardiac Surgery in Children, Statistics in Medicine. 33(29):5192-208.
Zhu Wang, Shuangge Ma and Ching-Yun Wang (2015) Variable selection for zero-inflated and overdispersed data with application to health care demand in Germany, Biometrical Journal. 57(5):867-84.
zipathdata("bioChemists", package = "pscl")
fm_zip <- zipath(art ~ . | ., data = bioChemists, nlambda=10)
plot(residuals(fm_zip) ~ fitted(fm_zip))
coef(fm_zip, model = "count")
coef(fm_zip, model = "zero")
summary(fm_zip)
logLik(fm_zip)Run the code above in your browser using DataLab