mzip {mzipmed} | R Documentation |
Marginalized Zero-Inflated Poisson Regression Model
Description
This function uses the MZIP model to allow you to fit counts variables
with excess zeroes
while allowing for easy interpretations. This function assumes that
the outcome and covariates are all the same sample size without missing
data. Covariates must be numerical, so binary predictors such as
gender or race need to be dummy coded with zeroes and ones. For more
information about this model and interpretations see Long, D Leann et al. "A marginalized
zero-inflated Poisson regression model with overall exposure effects." Statistics in
medicine vol. 33,29 (2014): 5151-65. doi:10.1002/sim.6293.
Note: BFGS likelihood optimization was used for this R package. For more information on use
of the offset
argument see vignette.
Usage
mzip(y, pred, print = TRUE, offset = NULL)
Arguments
y |
is the outcome variable |
pred |
is a vector of covariates (use cbind for multiple) |
print |
if =TRUE will give model parameters estimates and overall mean relative risks. Default =TRUE |
offset |
is an optional variable to be used as an offset, no need to log-transform prior |
Value
The function will return a list of results from the MZIP model.
In the list G(Gamma) refers to the excess zero/logistic part of the model
and A(Alpha) refers to the Poisson/mean part of the model for example.
Gest are the gamma coefficients for the logistic part of the MZIP model.
Aest are the alpha coefficients for the Poisson part of the MZIP model.
_ModelSE are the standard errors for each coefficient in the model.
_RobustSE are the robust standard errors for each coefficient in the model.
_ModelUpper are the upper confidence limits for each coefficient.
_ModelLower are the lower confidence limits.
_RobustUpper are the upper confidence limits based on robust standard error.
_RobustLower are the lower confidence limits based on robust standard errors.
_ModelZ are the Z scores for each coefficient.
_RobustZ are the robust Z scores for each coefficient.
_ModelZpval are the p-values based on the Z scores for the model.
_RobustZpval are the p-values based on the robust z scores.
AlphaCov is the covariance matrix for the poisson coefficient estimates
Cov is the covariance matrix for the MZIP model
RobAlphaCov robust covariance matrix for the Poisson component of MZIP
RobCov robust covariance matrix
loglik is the log-likelihood of the MZIP model
AIC is the Akaike's Information Criterion of the MZIP Model
BIC is the Bayesian's Information Criterion of the MZIP Model
Examples
test=mzip(y=mzipmed_data$ziY1,pred=cbind(mzipmed_data$X,mzipmed_data$C1,
mzipmed_data$C2),print=FALSE,offset=NULL)
## Not run:
test= mzip(y=mzipmed_data$ziY1,pred=cbind(X=mzipmed_data$X,C1=mzipmed_data$C1,
C2=mzipmed_data$C2),print=TRUE,offset=NULL)
## End(Not run)