View source: R/mice.impute.2l.lmer.R
mice.impute.2l.lmer | R Documentation |
lmer
Imputes univariate systematically and sporadically missing data using a
two-level normal model using lme4::lmer()
.
mice.impute.2l.lmer(y, ry, x, type, wy = NULL, intercept = TRUE, ...)
y |
Vector to be imputed |
ry |
Logical vector of length |
x |
Numeric design matrix with |
type |
Vector of length |
wy |
Logical vector of length |
intercept |
Logical determining whether the intercept is automatically added. |
... |
Arguments passed down to |
Data are missing systematically if they have not been measured, e.g., in the case where we combine data from different sources. Data are missing sporadically if they have been partially observed.
While the method is fully Bayesian, it may fix parameters of the variance-covariance matrix or the random effects to their estimated value in cases where creating draws from the posterior is not possible. The procedure throws a warning when this happens.
If lme4::lmer()
fails, the procedure prints the warning
"lmer does not run. Simplify imputation model"
and returns the
current imputation. If that happens we see flat lines in the
trace line plots. Thus, the appearance of flat trace lines should be taken
as an additional alert to a problem with imputation model fitting.
Vector with imputed data, same type as y
, and of length
sum(wy)
Shahab Jolani, 2017
Jolani S. (2017) Hierarchical imputation of systematically and sporadically missing data: An approximate Bayesian approach using chained equations. Forthcoming.
Jolani S., Debray T.P.A., Koffijberg H., van Buuren S., Moons K.G.M. (2015). Imputation of systematically missing predictors in an individual participant data meta-analysis: a generalized approach using MICE. Statistics in Medicine, 34:1841-1863.
Van Buuren, S. (2011) Multiple imputation of multilevel data. In Hox, J.J. and and Roberts, J.K. (Eds.), The Handbook of Advanced Multilevel Analysis, Chapter 10, pp. 173–196. Milton Park, UK: Routledge.
Other univariate-2l:
mice.impute.2l.bin()
,
mice.impute.2l.norm()
,
mice.impute.2l.pan()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.