mice.impute.2l.poisson | R Documentation |
The functions impute multilevel count data based on a two-level Poisson or negative binomial 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. Package glmmTMB is used to fit the model.
mice.impute.2l.poisson(y, ry, x, type, intercept = TRUE, wy = NULL,
EV = TRUE)
mice.impute.2l.poisson.noint(y, ry, x, type, intercept = FALSE, wy = NULL,
EV = TRUE)
mice.impute.2l.poisson.boot(y, ry, x, type, intercept = TRUE, wy = NULL,
EV = TRUE)
mice.impute.2l.poisson.noint.boot(y, ry, x, type, intercept = FALSE,
wy = NULL, EV = TRUE)
mice.impute.2l.nb(y, ry, x, type, intercept = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.nb.noint(y, ry, x, type, intercept = FALSE, wy = NULL,
EV = TRUE)
mice.impute.2l.nb.boot(y, ry, x, type, intercept = TRUE, wy = NULL,
EV = TRUE)
mice.impute.2l.nb.noint.boot(y, ry, x, type, intercept = FALSE, wy = NULL,
EV = TRUE)
mice.impute.2l.nb2(y, ry, x, type, intercept = TRUE, wy = NULL, EV = TRUE)
mice.impute.2l.nb2.noint(y, ry, x, type, intercept = FALSE, wy = NULL,
EV = TRUE)
mice.impute.2l.nb2.boot(y, ry, x, type, intercept = TRUE, wy = NULL,
EV = TRUE)
mice.impute.2l.nb2.noint.boot(y, ry, x, type, intercept = 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 |
|
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
2 = variable will be included as a fixed and random effect
The Bayesian regression variants (see Rubin 1987, p. 169-170) consist of the following steps:
Fit the model; find bhat, the posterior mean, and V(bhat), the posterior variance of model parameters b
Draw b* from N(bhat,V(bhat))
Obtain fitted values based on b*
Draw imputations for the incomplete part from appropriate distribution (Poisson or NB)
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 model to the bootstrap sample
Obtain fitted values
Draw imputations for the incomplete part from appropriate distribution (Poisson or NB)
Numeric vector of length sum(!ry)
with imputations
mice.impute.2l.poisson
: Bayesian Poisson regression variant; random intercept
mice.impute.2l.poisson.noint
: Bayesian NB regression variant; fixed intercept
mice.impute.2l.poisson.boot
: Bootstrap NB regression variant; random intercept
mice.impute.2l.poisson.noint.boot
: Bootstrap NB regression variant; fixed intercept
mice.impute.2l.nb
: Bayesian NB regression variant; random intercept
mice.impute.2l.nb.noint
: Bayesian NB regression variant; fixed intercept
mice.impute.2l.nb.boot
: Bootstrap NB regression variant; random intercept
mice.impute.2l.nb.noint.boot
: Bootstrap NB regression variant; fixed intercept
mice.impute.2l.nb2
: identical to mice.impute.2l.nb
; kept for backward compatibility
mice.impute.2l.nb2.noint
: identical to mice.impute.2l.nb.noint
; kept for backward compatibility
mice.impute.2l.nb2.boot
: identical to mice.impute.2l.nb.boot
; kept for backward compatibility
mice.impute.2l.nb2.noint.boot
: identical to mice.impute.2l.nb.noint.boot
; kept for backward compatibility
Kristian Kleinke
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.