Description Usage Arguments Details Value Examples
A Multicollinearity-adjusted Adaptive LASSO for Zero-inflated Count Regression fits zero-inflated regression models for count data via penalized maximum likelihood.
1 2 3 4 5 6 7 8 9 10 11 12 | AMAZonn(formula, data, weights, subset = NULL, na.action = na.omit,
offset = NULL, standardize = TRUE, family = c("poisson", "negbin",
"geometric"), link = c("logit", "probit", "cloglog", "cauchit", "log"),
control = zeroinfl.control(...), penalty = c("enet", "mnet", "snet"),
start = NULL, model = TRUE, y = TRUE, x = FALSE, nlambda = 100,
lambda.count = NULL, lambda.zero = NULL, penalty.factor.count = NULL,
penalty.factor.zero = NULL, lambda.count.min.ratio = 1e-04,
lambda.zero.min.ratio = 0.1, alpha.count = 1, alpha.zero = alpha.count,
gamma.count = 3, gamma.zero = gamma.count, rescale = FALSE, init.theta,
theta.fixed = FALSE, EM = TRUE, maxit.em = 200, convtype = c("count",
"both"), maxit = 1000, maxit.theta = 1, reltol = 1e-05,
eps.bino = 1e-05, shortlist = FALSE, trace = FALSE)
|
formula |
symbolic description of the model, see details. |
data, subset, na.action |
arguments controlling formula processing via model.frame. |
weights |
optional numeric vector of weights. |
offset |
optional numeric vector with an a priori known component to be included in the linear predictor of the count model. See below for more information on offsets. |
standardize |
Logical flag for x variable standardization, prior to fitting the model sequence. The coefficients are always returned on the original scale. Default is standardize=TRUE. |
family |
character specification of count model family (a log link is always used). |
link |
character specification of link function in the binary zero-inflation model (a binomial family is always used). |
control |
a list of control arguments specified via zeroinfl.control. |
penalty |
penalty considered as one of enet, mnet, snet. |
start |
starting values for the parameters in the linear predictor. |
model, y, x |
logicals. If TRUE the corresponding components of the fit (model frame, response, model matrix) are returned. |
nlambda |
number of lambda value, default value is 100. The sequence may be truncated before nlambda is reached if a close to saturated model for the zero component is fitted. |
lambda.count |
A user supplied lambda.count sequence. Typical usage is to have the program compute its own lambda.count and lambda.zero sequence based on nlambda and lambda.min.ratio. |
lambda.zero |
A user supplied lambda.zero sequence. |
penalty.factor.count, penalty.factor.zero |
These are numeric vectors with the same length as predictor variables. that multiply lambda.count,lambda.zero, respectively, to allow differential shrinkage of coefficients. Can be 0 for some variables, which implies no shrinkage, and that variable is always included in the model. Default is same shrinkage for all variables. |
lambda.count.min.ratio, lambda.zero.min.ratio |
Smallest value for lambda.count and lambda.zero, respectively, as a fraction of lambda.max, the (data derived) entry value (i.e. the smallest value for which all coefficients are zero except the intercepts). Note, there is a closed formula for lambda.max for penalty="enet". If rescale=TRUE, lambda.max is the same for penalty="mnet" or "snet". Otherwise, some modifications are required. In the current implementation, for small gamma value, the square root of the computed lambda.zero[1] is used when penalty="mnet" or "snet". |
alpha.count |
The elastic net mixing parameter for the count part of model. |
alpha.zero |
The elastic net mixing parameter for the zero part of model. |
gamma.count |
The tuning parameter of the snet or mnet penalty for the count part of model. |
gamma.zero |
The tuning parameter of the snet or mnet penalty for the zero part of model. |
rescale |
logical value, if TRUE, adaptive rescaling |
init.theta |
The initial value of theta for family="negbin". |
theta.fixed |
Logical value only used for family="negbin". If TRUE, theta is not updated. |
EM |
Using EM algorithm. Not implemented otherwise |
maxit.em |
Maximum number of EM algorithm |
convtype |
convergency type, default is for count component only for speedy computation |
maxit |
Maximum number of coordinate descent algorithm |
maxit.theta |
Maximum number of iterations for estimating theta scaling parameter if family=" negbin". Default value maxit.theta may be increased, yet may slow the algorithm |
reltol |
Convergence criteria, default value 1e-5 may be reduced to make more accurate yet slow |
eps.bino |
a lower bound of probabilities to be claimed as zero, for computing weights and related values when family="binomial". |
shortlist |
logical value, if TRUE, limited results return |
trace |
If TRUE, progress of algorithm is reported |
The algorithm fits penalized zero-inflated count data regression models using the coordinate descent algorithm within the EM algorithm. The returned fitted model object is of class "AMAZonn" and is similar to fitted "glm" and "zeroinfl" objects. For elements such as "coefficients" a list is returned with elements for the zero and count component, respectively.
The function AMAZonn returns a list of following components
coefficients |
a list with elements "count" and "zero" containing the coefficients from the respective models, |
residuals |
a vector of raw residuals (observed - fitted), |
fitted.values |
a vector of fitted means, |
weights |
the case weights used, |
terms |
a list with elements "count", "zero" and "full" containing the terms objects for the respective models, |
theta |
estimate of the additional θ parameter of the negative binomial model (if a negative binomial regression is used), |
loglik |
log-likelihood of the fitted model, |
family |
character string describing the count distribution used, |
link |
character string describing the link of the zero-inflation model, |
linkinv |
the inverse link function corresponding to link, |
converged |
logical value, TRUE indicating successful convergence of AMAZonn, FALSE indicating otherwise |
call |
the original function call |
formula |
the original formula |
levels |
levels of the categorical regressors |
contrasts |
a list with elements "count" and "zero" containing the contrasts corresponding to levels from the respective models, |
model |
the full model frame (if model = TRUE), |
y |
the response count vector (if y = TRUE), |
x |
a list with elements "count" and "zero" containing the model matrices fromthe respective models (if x = TRUE), |
1 2 3 4 5 6 | data("docvisits", package = "zic")
## with simple inflation (no regressors for zero component)
Zonn_zip <- AMAZonn(docvisits ~ . | ., data = docvisits, family = "poisson", nlambda = 10)
summary(Zonn_zip)
Zonn_zinb <- AMAZonn(docvisits ~ . | ., data = docvisits, family = "negbin", nlambda=10)
summary(Zonn_zinb)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.