Why Both Levels Must Be Updated Together
When variables are incomplete at both levels of a nested data set, imputing one level and then treating its imputations as fixed while imputing the other can fail to represent their dependence. A cluster-level covariate may help predict an individual outcome, while the cluster’s outcomes may in turn provide information about its missing cluster-level covariate. Chained equations can represent this feedback by repeatedly updating each incomplete variable using the current values of the others.
The data structure must remain intact throughout. A level-1 variable has one value per individual, so its missing values are imputed for individuals. A level-2 variable has one value per cluster, even if it is displayed on every individual row. Its missing value is drawn once for the cluster and then assigned consistently to all rows in that cluster.
Let \(Y_{ij}\) be a level-1 outcome for individual \(i\) in cluster \(j\), and let \(Z_j\) be a level-2 covariate shared by the individuals in cluster \(j\). Other predictors may be complete or incomplete. A sweep might update \(Y\) using the current \(Z\), then update \(Z\) using the newly completed \(Y\), and repeat. Every value used in an update is therefore either observed or the current imputation, not an unresolved blank.
Assumptions and a Coherent Updating Scheme
The missingness assumption commonly used to justify imputation under the observed-data model is that missingness is conditionally independent of the missing values given the variables included in the analysis and imputation models. This is the missing at random assumption, conditional on those variables. It does not make an unsuitable imputation model valid: the models must also reflect the nesting, variable types, and relationships relevant to the intended analysis. When missingness may depend on unobserved values even after conditioning, sensitivity analysis is needed; the earlier material on Missing Data covers that broader issue.
A basic two-level illustration uses a random-intercept model for the level-1 variable and a cluster-level conditional model for the level-2 variable:
Here \(X_{ij}\) is a level-1 predictor, \(u_j\) represents residual cluster differences, and \(\epsilon_{ij}\) is an individual-level residual. This model presumes the stated linear mean structure and, for this normal version, normally distributed random effects and residuals with the stated variances. A suitable level-2 conditional model could, for example, relate \(Z_j\) to a cluster-level predictor \(V_j\) and a cluster summary of \(Y\). That summary must be calculated once per cluster from the current completed \(Y\) values. In an actual application, the conditional models must match the variable types and analysis estimand; these normal equations are an illustration, not a universal prescription.
One practical sweep updates each incomplete variable once, in a specified order. For the two variables above, first update missing \(Y_{ij}\) using the current \(Z_j\) and other predictors; next update each missing \(Z_j\) using the current completed level-1 data and cluster-level predictors. On the next sweep, \(Y\) is updated using the new \(Z\). The order is not a guarantee of a valid joint model: the conditional models should be compatible with a plausible joint distribution, or at least be scrutinized for severe incompatibility.
Create starting values for every incomplete variable, retaining observed values and assigning each level-2 value once per cluster.
Draw model parameters and missing individual values conditional on the current cluster-level values and the other available predictors.
Construct its predictors at the cluster level from current completed data, draw one value for each cluster with missingness, and propagate it to that cluster’s rows.
Continue sweeps until chains show adequate mixing and stabilization, then retain multiple completed data sets after suitable iterations.
Worked Updates Across Levels
Worked Example: Keeping the Two Levels Straight
Consider hypothetical data from two clinics. Clinic A has three patients, and Clinic B has two. A patient-level outcome \(Y_{ij}\) is missing for one patient in Clinic A. A clinic-level covariate \(Z_j\) is missing for Clinic B and is recorded on each patient row. The observed values of \(Z_A\) are both 2, while the two displayed values of \(Z_B\) are both blank.
The missing \(Y\) is one individual-level cell, so the level-1 model produces one draw for that patient. The missing \(Z_B\) is one clinic-level cell, not two independent missing values: impute a single \(Z_B\), then put that same value on both Clinic B rows. The observed \(Z_A=2\) remains fixed in every sweep.
This accounting check is essential before modeling. If the two blank rows for Clinic B were imputed independently, the data could assign different covariate values to patients in the same clinic, contradicting the definition of \(Z_j\). The correct number of level-2 imputations is the number of clusters with missing \(Z\), not the number of rows displaying it.
Worked Example: Updating a Level-1 Outcome
Suppose a hypothetical patient in Clinic B has missing \(Y_{ij}\), and the current imputed clinic value is \(Z_B=3.9\). Assume the level-1 conditional model has current draws \(\beta_0=10\), \(\beta_1=2\), \(\beta_2=0.5\), and \(u_B=1\), with \(X_{ij}=4\). For this illustration, the residual standard deviation is \(\sigma=2\). The conditional mean is
If the current parameter draw and a standard-normal residual draw \(e=-0.30\) are used, the imputed value is
Thus this sweep assigns \(20.35\) outcome units to that patient. It is a stochastic imputation, not a prediction claimed to be the patient’s known outcome. In practice, uncertainty in regression parameters and cluster effects must also be represented; holding them fixed here only makes the arithmetic transparent.
Worked Example: Updating a Level-2 Covariate
Suppose the current level-2 imputation model for a hypothetical cluster covariate is
For a cluster with \(V_j=2\), suppose the current completed level-1 outcomes have cluster mean \(\bar{Y}_j=11\). This model uses one cluster mean, not one predictor row for every patient. The conditional mean is
The conditional standard deviation is \(0.6\), because the second argument of the normal distribution is the variance, \(0.6^2\). If a standard-normal draw is \(-0.5\), the imputed value is
The value \(3.9\) is assigned to the cluster as a whole. In the next sweep, it can enter the level-1 model for that cluster’s missing \(Y\) values. The calculation assumes the model’s conditional mean and normal residual distribution are appropriate; it does not establish that they are.
Why the Order Matters, and Where Coherence Can Fail
The updates are not independent steps that can be performed once and then forgotten. If a newly imputed \(Z_j\) predicts \(Y_{ij}\), the next level-1 update should use it. If the level-2 model uses a summary of \(Y\), that summary should reflect the current completed \(Y\) values. Repeating updates allows these dependencies to feed back through the chain.
A short justification shows why one should not treat the variables as unrelated. If the conditional models truly come from a joint distribution for \((Y,Z)\), the joint conditional distribution of missing values is governed by both pieces:
Alternating draws from compatible full conditional distributions can therefore move through the joint distribution, rather than freezing one variable while the other is updated. But in chained equations, separately specified conditional models do not automatically correspond to any joint distribution. Incompatibility may lead to order-sensitive behavior or distributions that are hard to interpret. Matching levels, predictors, and analysis relationships makes the system more credible, but does not prove compatibility.
The level-2 unit also matters mathematically. If \(Z_j\) is a single cluster-level random variable, its contribution to a level-2 model is one cluster-level contribution. Treating its repeated row entries as independent observations would effectively multiply that contribution by the number of individuals and overstate the information about \(Z_j\). This is why the level-2 update is performed once per cluster, even if software stores data in long, individual-row format.
Diagnostics, Alternatives, and Limitations
Diagnostics should be performed separately for variables at each level and for important cluster summaries. Trace plots or iteration summaries can reveal drifting means, variances, or proportions; compare chains started from different plausible initial values. Also inspect imputed distributions against observed distributions, within-cluster patterns, and relationships that the substantive analysis relies on. A stable trace alone does not show that the imputation models are correctly specified.
- Check the data level. Confirm that each level-2 variable is constant within cluster after every update, and that observed cells have not been overwritten.
- Check conditional predictions. Look for implausible ranges, residual patterns, extreme draws, and missing categories or values that the model cannot generate.
- Check cluster summaries. Ensure that means or other aggregates use the current completed values and the intended definition, rather than being inadvertently duplicated as independent observations.
- Check sensitivity to order and specification. Marked changes across reasonable update orders or model choices can signal incompatible conditionals or weakly identified relationships.
A joint multilevel model specifies a distribution for the variables together and can make their dependence explicit, but it requires a credible joint model and may be computationally demanding. Multilevel chained equations offer flexible variable-by-variable models, but conditional compatibility is not automatic. Single-level imputation is simpler, yet it can miss within- and between-cluster structure and can distort the analysis. Complete-case analysis avoids imputation but discards incomplete units and may be inefficient or biased under relevant missingness mechanisms. None is universally preferable; selection depends on the estimand, data structure, missingness assumptions, and plausible models.
This approach also has limits. Sparse data at one level can make conditional models unstable; strong missingness can leave cluster-level relationships weakly identified; and an unsuitable conditional distribution can generate implausible imputations even if the chain appears to settle. The method does not remove the need for sensitivity analysis when the missing-at-random assumption is uncertain. For unequal cluster sizes, few clusters, or specialized variable types, additional modeling choices are needed rather than assuming this basic normal illustration suffices.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- A cluster-level covariate is missing on four rows belonging to the same cluster. How many distinct imputations should be drawn for that cluster?
- In a level-2 model, the conditional mean is \(2+0.4V_j+0.1\bar{Y}_j\). If \(V_j=5\) and \(\bar{Y}_j=8\), compute the mean.
- Why should the next level-1 update use the latest imputed level-2 value?
- Name one diagnostic that checks whether the imputation respects the data hierarchy, and one limitation that a stable chain does not resolve.
Solutions. (1) One draw, assigned identically to all four rows, because the value exists once for that cluster. (2) \(2+0.4(5)+0.1(8)=2+2+0.8=4.8\). (3) The level-2 value can predict the level-1 variable, so retaining an older value would fail to use the current completed data in the specified conditional update. (4) Check that the level-2 variable is constant within cluster after every sweep; a stable chain does not establish correct model specification or resolve missing-not-at-random concerns.