Why a Cluster-Level Predictor Belongs in the Model
Suppose a study records a health outcome for patients nested within clinics. Clinic funding is observed for every clinic, while the outcome is missing for some patients. Funding does not vary from patient to patient within a clinic, but it may help explain why outcomes differ across clinics. A level-1 imputation model that omits funding can therefore miss a relevant source of between-clinic variation.
The key distinction is between where a predictor varies and which outcomes it can help predict. A clinic-level predictor can inform the imputation of patient-level values. Its appearance in each patient’s data-table row is a convenient way to join clinic information to patient records; it does not turn that predictor into a separately measured patient characteristic.
A Model and Its Assumptions
A common model for a continuous, approximately normal level-1 variable is a random-intercept model:
Here \(\beta_W\) is the association between the cluster-level predictor and the outcome, conditional on the other included terms. The random intercept \(b_j\) represents residual cluster differences not explained by the predictors. The level-1 residual is \(\varepsilon_{ij}\). For the usual normal-model calculations below, assume \(b_j\sim N(0,\tau^2)\), \(\varepsilon_{ij}\sim N(0,\sigma^2)\), and that random intercepts are independent across clusters.
The independence conditions matter. Assume that the random intercepts are independent of the predictors, and that the residuals are independent of the random intercepts and predictors and mutually independent across individuals. These assumptions imply that, conditional on the predictors and averaging over the random intercept and residual, the mean and variance are:
For two distinct individuals \(i\) and \(k\) in the same cluster, their only shared random component is \(b_j\). Under the stated independence assumptions, their conditional covariance is \(\tau^2\). Thus the model represents both the relationship with \(W_j\) and residual dependence among outcomes in the same cluster. If residuals and random intercepts are correlated, these moment and covariance expressions need not hold.
For an imputation model, also require that the conditional distribution is an adequate description of the variable being imputed, that the predictors used are appropriate for the analysis, and that the missingness assumptions are credible given the information included. In particular, including an observed \(W_j\) can make missingness more plausibly conditionally independent of the unobserved \(X_{ij}\), but does not guarantee that assumption. There must also be enough between-cluster information to estimate the effect of \(W_j\); many individual rows cannot substitute for a small number of distinct clusters.
How the Predictor Informs an Imputation
The fixed effect \(\beta_W W_j\) shifts the expected value for every member of a cluster according to its observed predictor value. The random intercept then lets observed outcomes in that same cluster provide additional information about the cluster’s residual level. For an individual with missing \(X_{ij}\), the imputation can therefore use both the predictors and the observed outcomes of other members of the cluster.
To make this borrowing explicit, suppose model parameters are known and the other predictors are observed. Subtract the fixed part of the model from each observed value in cluster \(j\), giving residuals \(r_{ij}=x_{ij}-(\beta_0+\beta_W W_j+\boldsymbol{\beta}_Z^\mathsf{T}Z_{ij})\). If there are \(n_j^{\mathrm{obs}}\) observed outcomes in that cluster, normal updating gives:
A missing value with fixed part \(f_{ij}=\beta_0+\beta_W W_j+\boldsymbol{\beta}_Z^\mathsf{T}Z_{ij}\) then has predictive distribution \(N(f_{ij}+m_j,\sigma^2+V_j)\), under these known-parameter assumptions. This is a prediction conditional on the observed outcomes in that cluster, not merely the marginal distribution conditional on \(W_j\) and \(Z_{ij}\). In practice, a proper multiple-imputation procedure also represents uncertainty in model parameters; the known-parameter calculation isolates the role of the cluster information.
Worked Example: The Fixed Effect of an Observed Cluster Predictor
Suppose the fitted fixed part of a hypothetical level-1 model is \(10+3W_j+2Z_{ij}\), where \(W_j\) is a clinic funding category coded 0 or 1 and \(Z_{ij}\) is a centered patient predictor. For a patient with \(Z_{ij}=0\), compare the fixed-part predictions for the two funding categories.
For \(W_j=0\), the fixed part is \(10+3(0)+2(0)=10\). For \(W_j=1\), it is \(10+3(1)+2(0)=13\). Thus the model assigns the second category a fixed-part prediction 3 outcome units higher, conditional on the other included terms.
These are not final predictions for every patient in the two clinics: each patient’s model value also includes the cluster intercept and individual residual. The calculation shows how an observed cluster-level covariate informs the imputation without claiming that funding varies among patients within a clinic.
Worked Example: Updating a Cluster Prediction From Observed Members
Consider a hypothetical model with known parameters \(\beta_0=10\), \(\beta_W=3\), \(\beta_Z=2\), \(\tau^2=4\), and \(\sigma^2=9\). In a clinic with \(W_j=1\), two patients have \(Z_{ij}=0\) and observed outcomes 17 and 20. A third patient also has \(Z_{ij}=0\), but the outcome is missing. Calculate the predictive mean and variance for that missing outcome, conditional on the two observed outcomes.
The fixed part for each patient is \(10+3(1)+2(0)=13\). The two observed residuals are \(17-13=4\) and \(20-13=7\). There are \(n_j^{\mathrm{obs}}=2\) observations, so:
The posterior mean of the cluster intercept is:
The missing patient’s predictive mean is \(13+2.588=15.588\) outcome units, and the predictive variance is \(9+2.118=11.118\) squared outcome units. Its predictive standard deviation is \(\sqrt{11.118}\approx 3.334\) outcome units. A stochastic imputation draws from this predictive distribution (and, in an actual analysis, also accounts for parameter uncertainty); entering 15.588 for every such missing value would omit predictive variation.
Worked Example: Repeated Rows Do Not Create More Clusters
In a hypothetical data set, three clinics have predictor values \(W_j=0,1,2\), respectively. Each clinic has two patients, and their observed outcome values are 5 and 5 in the first clinic, 7 and 7 in the second, and 9 and 9 in the third. Calculate the ordinary row-level least-squares slope of outcome on \(W_j\), and identify what the calculation does and does not establish.
Across the six rows, the mean predictor is \(\bar{x}_W=(0+0+1+1+2+2)/6=1\), and the mean outcome is \(\bar{x}_X=(5+5+7+7+9+9)/6=7\). The slope numerator is \(2[(-1)(-2)]+2[(0)(0)]+2[(1)(2)]=8\). The denominator is \(2(-1)^2+2(0)^2+2(1)^2=4\). Therefore the slope is \(8/4=2\) outcome units per unit of \(W_j\).
The arithmetic describes the observed between-clinic pattern: the mean outcome rises by 2 units for each one-unit increase in the clinic predictor in this small example. But there are only three distinct predictor values, one per clinic. The six rows are not six independent measurements of \(W_j\), and an ordinary regression’s row-independent standard error would not account for within-clinic dependence. A multilevel model represents that dependence; the example alone does not establish precise or generalizable evidence for the slope.
Implementation, Checks, and Alternatives
In a chained-equations setting, the conditional imputation model for \(X_{ij}\) should include the observed \(W_j\), relevant level-1 predictors, and the cluster structure required by the analysis. The value of \(W_j\) is joined to each individual record in its cluster, but its coefficient is learned from comparisons across clusters. For a continuous normal model, the random-intercept specification above is one way to preserve residual clustering while using \(W_j\). The imputation procedure should generate stochastic values rather than replacing missing outcomes by conditional means alone.
Useful checks include the following:
- Check that \(W_j\) is constant within each cluster and correctly linked to all its individual records.
- Compare observed and imputed \(X_{ij}\) distributions across values or categories of \(W_j\). Large unexplained discrepancies can indicate a misspecified effect, coding problem, or poor overlap.
- Inspect whether clusters with observed outcomes show residual patterns that remain after the included predictors and random intercept are considered.
- Check the number of distinct clusters and the spread of \(W_j\) across them. A coefficient based on very few distinct clusters can be unstable even when the row count is large.
- Check that imputed values are plausible for the outcome’s scale and that repeated imputations vary. Implausible values or nearly identical imputations can signal a poor conditional model or insufficient stochastic uncertainty.
Ignoring \(W_j\) can leave systematic between-cluster differences unexplained when it is associated with \(X_{ij}\). Ordinary regression with an independent residual for every row may include \(W_j\), but it does not represent shared cluster variation and can give inappropriate uncertainty. Cluster indicators can account for observed cluster-specific differences, but they use a separate indicator for each cluster and cannot estimate a general effect for a level-2 predictor that is constant within each cluster alongside a full set of cluster indicators. A random-intercept model instead allows residual cluster variation while estimating the common association with \(W_j\).
No model choice removes the need for judgment. A linear term may be inadequate if the relationship with \(W_j\) is nonlinear; a normal conditional model may be unsuitable for a strongly non-normal variable; and a level-2 predictor with little variation across clusters offers little information for its effect. This tutorial treats \(W_j\) as observed. It does not address imputing missing cluster-level predictors, nor does adding \(W_j\) alone guarantee a correctly specified imputation model or make a nonignorable missingness process ignorable.
Common Mistake
Check Your Understanding
Answer each question, then compare with the solutions.
- In the random-intercept model, what information does \(\beta_W W_j\) provide, and what additional information does \(b_j\) represent?
- Why are the usual marginal variance and within-cluster covariance formulas not justified unless the residuals are independent of the random intercepts?
- A cluster has one observed residual \(r=3\), with \(\tau^2=2\) and \(\sigma^2=8\). Calculate \(V_j\) and \(m_j\).
- A clinic-level variable has the same value on every patient row within each clinic. What is the relevant replication for learning its association with the outcome?
- Name one reason that including an observed cluster-level predictor does not by itself guarantee valid imputations.
Solutions. (1) \(\beta_W W_j\) shifts the fixed-part expectation according to the observed cluster predictor; \(b_j\) represents residual cluster-specific deviation after the included predictors. (2) If residuals correlate with the random intercept, their covariance contributes to the total variance and within-cluster covariance, so the formulas based only on \(\tau^2\) and \(\sigma^2\) need not hold. (3) \(V_j=(1/2+1/8)^{-1}=(5/8)^{-1}=1.6\). Then \(m_j=1.6(3/8)=0.6\). (4) The predictor varies across clusters, so its association is informed by the distinct clusters and their predictor values, not by treating repeated entries as independent measurements. (5) For example, the conditional model may be misspecified, there may be too few clusters or insufficient predictor variation, or missingness may depend on unobserved values even after conditioning on included information.