mice.impute.2l.hnb | R Documentation |
The functions impute zero-inflated multilevel count data based on a two-level Poisson or negative binomial hurdle model, either using a Bayesian regression or a bootstrap regression approach (appendix: “.boot
”). The .noint
variants treat the intercept only as a fixed, but not as a random effect. It may be specified, if the intercept is excluded from the random part of the zero model (“.noint.zero
”), the count model (“.noint.count
”), or both models (“.noint.both
”). Hurdle models are mixture models and consist of two model components: the zero model (a binomial generalized linear mixed effects model), determining, if the observational unit has a zero or non-zero value, and the count model (a zero-truncated two-level Poisson or NB model), determining, what non-zero value the observational unit has.
mice.impute.2l.hnb(y, ry, x, type, intercept.c = TRUE, intercept.z = TRUE,
wy = NULL, EV = TRUE)
mice.impute.2l.hnb.boot(y, ry, x, type, intercept.c = TRUE,
intercept.z = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.hnb.noint.both.boot(y, ry, x, type, intercept.c = FALSE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hnb.noint.both(y, ry, x, type, intercept.c = FALSE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hnb.noint.count.boot(y, ry, x, type, intercept.c = FALSE,
intercept.z = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.hnb.noint.count(y, ry, x, type, intercept.c = FALSE,
intercept.z = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.hnb.noint.zero.boot(y, ry, x, type, intercept.c = TRUE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hnb.noint.zero(y, ry, x, type, intercept.c = TRUE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hp(y, ry, x, type, intercept.c = TRUE, intercept.z = TRUE,
wy = NULL, EV = TRUE)
mice.impute.2l.hp.boot(y, ry, x, type, intercept.c = TRUE,
intercept.z = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.hp.noint.both.boot(y, ry, x, type, intercept.c = FALSE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hp.noint.both(y, ry, x, type, intercept.c = FALSE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hp.noint.count.boot(y, ry, x, type, intercept.c = FALSE,
intercept.z = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.hp.noint.count(y, ry, x, type, intercept.c = FALSE,
intercept.z = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.hp.noint.zero.boot(y, ry, x, type, intercept.c = TRUE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
mice.impute.2l.hp.noint.zero(y, ry, x, type, intercept.c = TRUE,
intercept.z = FALSE, wy = NULL, EV = TRUE)
y |
Numeric vector with incomplete data in long format (i.e. the groups are stacked upon each other) |
ry |
Response pattern of |
x |
matrix with |
type |
vector of length |
intercept.c |
|
intercept.z |
|
wy |
Logical vector of length |
EV |
should automatic outlier handling of imputed values be enabled? Default is |
Model specification details:
-2 = class variable (only one class variable is allowed!)
0 = variable not included in imputation model
1 = variable will be included as a fixed effect (zero and count model)
2 = variable will be included as a fixed and random effect (zero and count model)
3 = variable will be included as a fixed effect (count model only)
4 = variable will be included as a fixed and random effect (count model only)
5 = variable will be included as a fixed effect (zero model only)
6 = variable will be included as a fixed and random effect (zero model only)
The Bayesian regression variants (see Rubin 1987, p. 169-170) consist of the following steps:
Fit the zero model (a two-level binomial generalized linear mixed effects model), using the glmmTMB
function from package glmmTMB; find bhat, the posterior mean, and V(bhat), the posterior variance of model parameters b
Draw b* from N(bhat,V(bhat))
Compute predicted probabilities for having a zero vs. non-zero count
Draw imputations (zeros and ones) from a binomial distribution with the respective individual probabilities obtained from step 3.
Fit the count model (a zero-truncated two-level Poisson or NB model) using the glmmTMB
function from package glmmTMB; find bhat, the posterior mean, and V(bhat), the posterior variance of model parameters b.
Draw b* from N(bhat,V(bhat))
Compute predicted values using parameters b* and replace non-zero imputations (from step 4) by a draw from a zero-truncated NB distribution with mean parameter mu being the count predicted for the respective incomplete case.
The bootstrap functions draw a bootstrap sample from y[ry]
and x[ry,]
(Note: we resample clusters rather than individual cases) and consist of the following steps:
Fit the zero model to the bootstrap sample
Compute predicted probabilities for having a zero vs. non-zero count
Draw imputations from a binomial distribution.
Fit the count model to the boostrap sample
Compute predicted counts and draw non-zero imputations (from step 3) from a zero-truncated Poisson or NB distribution.
Numeric vector of length sum(!ry)
with imputations
mice.impute.2l.hnb
: Bayesian regression variant; random intercepts
mice.impute.2l.hnb.boot
: bootstrap regression variant; random intercepts
mice.impute.2l.hnb.noint.both.boot
: bootstrap regression variant; fixed intercepts
mice.impute.2l.hnb.noint.both
: Bayesian regression variant; fixed intercepts
mice.impute.2l.hnb.noint.count.boot
: bootstrap regression variant; fixed intercept in count model
mice.impute.2l.hnb.noint.count
: Bayesian regression variant; fixed intercept in count model
mice.impute.2l.hnb.noint.zero.boot
: bootstrap regression variant; fixed interceot in zero model
mice.impute.2l.hnb.noint.zero
: Bayesian regression variant; fixed intercept in zero model
mice.impute.2l.hp
: Bayesian regression variant; random intercepts
mice.impute.2l.hp.boot
: bootstrap regression variant; random intercepts
mice.impute.2l.hp.noint.both.boot
: bootstrap regression variant; fixed intercepts
mice.impute.2l.hp.noint.both
: Bayesian regression variant; fixed intercepts
mice.impute.2l.hp.noint.count.boot
: bootstrap regression variant; fixed intercept in count model
mice.impute.2l.hp.noint.count
: Bayesian regression variant; fixed intercept in count model
mice.impute.2l.hp.noint.zero.boot
: bootstrap regression variant; fixed interceot in zero model
mice.impute.2l.hp.noint.zero
: Bayesian regression variant; fixed intercept in zero model
Kristian Kleinke
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.