mlmice: Multilevel multiple imputation by chained equations in Stata
Missing values in clustered data, such as students in schools, are common, but Stata has no built-in command that imputes them under a multilevel model. Single-level imputation ignores the clustering and distorts variance components and contextual effects. In this article, I introduce mi impute mlmice, a user-defined method for mi impute that imputes continuous and binary variables at the individual and at the cluster level by fully conditional specification with random-intercept models. Level-1 models include the cluster means of the other level-1 variables, so that effects within and between clusters can differ. The command follows the defaults of the R packages mice and miceadds where they are sound and deviates from them where they are not, for example with a prior for the between-cluster variance that does not depend on the units of a variable. I describe the method, the syntax and two examples, one with simulated data and one with data from the German National Educational Panel Study. An extensive validation, with unit tests, comparisons with exact posteriors and with R, and a simulation study with eight conditions, shows that the command keeps coverage of 95% intervals near the nominal level and, at low intraclass correlations, recovers contextual effects and between-cluster variances better than jomo and mice with their defaults, in less time. Its main weakness, shared with those packages, is that with few small clusters and a low intraclass correlation it overstates the between-cluster variance and understates the contextual effect.
Authors
- Felix Bittmann (ORCID: https://orcid.org/0000-0003-0802-5854)
Institutions
- Leibniz Institute for Educational Trajectories (DE)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-11
- DOI
- https://doi.org/10.5281/zenodo.24128114
- Primary Topic
- Statistical Methods and Bayesian Inference
- Type
- article
- Field-Weighted Citation Impact
- 0.00