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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

mlmice: Multilevel multiple imputation by chained equations in Stata

Felix Bittmann
Zenodo (CERN European Organization for Nuclear Research)
Statistical Methods and Bayesian Inference
article

mlmice: Multilevel multiple imputation by chained equations in Stata

Felix Bittmann
article en

Abstract

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.

Zenodo (CERN European Organization for Nuclear Research)
Leibniz Institute for Educational Trajectories (DE)
Statistical Methods and Bayesian Inference
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon