Why the Imputation Unit Matters
In nested data, a level-2 variable belongs to a cluster: for example, a clinic’s region, a school’s funding category, or a household’s dwelling type. Long-format data store one row per member, so the same cluster-level value often appears on every row for that cluster. Those repeated entries are copies of one value, not separate measurements. When the value is missing, the imputation must respect that structure.
The central rule is simple: make one imputation draw for each cluster, then use that same draw on every member row in that cluster. This is a rule about the unit of the target variable, not a claim that every predictor must be summarized to one row. If individual-level information is used to predict a cluster-level value, the model must account for the nesting rather than treating copied values as independent observations.
This distinction is especially important in chained equations, where an update for one incomplete variable is conditional on other variables. For a level-2 target, the conditional model and its data representation must not mistake the \(n_i\) long-format copies for \(n_i\) independent realizations of the target. The number of target records is the number of clusters with a value, not the number of member rows.
Represent the Target Once Per Cluster
A reliable implementation separates the target variable from its long-format copies. Make a cluster-level table with one record per cluster and one value of each level-2 variable. Fit or update the imputation model on that table, obtain one draw for every cluster requiring an imputation, and then join the result back to the member-level data by cluster ID. The join broadcasts the single draw; it does not create new draws.
If the imputation model uses information measured on members, that information needs a suitable representation. One option is a cluster summary, such as a mean or proportion. Such summaries may be noisy when based on a small number of members, so treating them as exact measurements can be misleading; the earlier material on Cluster Means And Their Sampling Uncertainty is relevant. Another option is a multilevel conditional model that uses individual records while explicitly representing their clustering. Either way, repeated copies of \(Z_i\) are not independent outcome records.
Confirm that the variable is conceptually defined once per cluster, and that each cluster has one ID.
Use one record per cluster for a cluster-level imputation model, or specify a multilevel model that respects the nested structure if member-level information is used.
For each imputed data set, generate one value for each cluster with an incomplete target.
Join the draw to all member rows by cluster ID, then check that the completed variable has only one value within each cluster.
Worked Example: Turning Repeated Copies into One Cluster Record
Suppose a hypothetical study records three members in clinic A, two in clinic B, and three in clinic C. The clinic’s service region is a level-2 variable. In the long data, region is recorded as North for all three A rows, South for both B rows, and missing for all three C rows. The cluster IDs and region entries are:
| Cluster | Number of member rows | Region entries in long data |
|---|---|---|
| A | 3 | North, North, North |
| B | 2 | South, South |
| C | 3 | Missing, Missing, Missing |
There are three cluster records, not eight independent region observations. The cluster-level table is A: North, B: South, C: missing. A model for region is updated once for C. Suppose, for illustration, its draw is West. The value is then copied to every C row:
| Cluster | Completed region on each member row |
|---|---|
| A | North, North, North |
| B | South, South |
| C | West, West, West |
The single draw for clinic C is West. It would be incorrect to draw the region independently for each of its three members, because that could assign multiple regions to the same clinic. The example assumes that the recorded cluster IDs are correct and that the level-2 definition is valid; a disagreement among observed region entries within A or B would require resolving a data or coding problem before imputation.
Why Row-Wise Imputation Changes the Model
The problem with treating copies as independent can be seen in a simple likelihood calculation. Suppose the true cluster-level values \(Z_i\) follow a normal model with mean \(\mu\) and known variance \(\sigma^2\), independently across clusters. The likelihood based on one value per cluster is proportional to:
If the same \(Z_i\) is mistakenly treated as an independent observation on each of its \(n_i\) member rows, the resulting likelihood is instead proportional to:
The extra factor \(n_i\) in the exponent gives cluster \(i\) weight in proportion to its size. The row-wise model has changed the target calculation: it treats the repeated copies as repeated evidence about \(\mu\), even though they contain no new measurement of \(Z_i\). In an imputation model, such pseudo-replication can distort fitted relationships and uncertainty, not just produce an inconvenient data layout.
Worked Example: How Unequal Cluster Sizes Create Pseudo-Replication
Consider a hypothetical continuous cluster-level measurement \(Z\) observed in two clusters. Cluster A has \(n_1=1\) member and \(Z_1=0\); cluster B has \(n_2=9\) members and \(Z_2=10\). Under a normal model with known common variance, the maximum-likelihood estimate of \(\mu\) based on one value per cluster is the cluster mean:
If the repeated long-format copies are treated as separate observations, the row-weighted estimate becomes:
The result changes from 5 to 9 solely because the second cluster has more member rows. If the target is the average value across clusters, 5 is the relevant estimate for this illustration; 9 answers a different, size-weighted question. The calculation assumes the two observed cluster values are the units to be averaged. More complex models may target other quantities, but they must specify that target rather than introduce size weighting accidentally.
Model Conditions and Practical Choices
The cluster-level approach relies on a clear data-generating structure. Cluster IDs must identify the intended units; the target must genuinely be constant within each cluster; and the conditional imputation model must be appropriate for the target’s scale and relationships. For standard chained-equation reasoning, the imputation model also needs to represent the relevant observed predictors and the missingness process sufficiently well for the intended analysis. A common working condition is missing at random conditional on variables in the imputation model, together with adequate overlap in predictor patterns. This condition is not guaranteed by deduplicating the data.
The model should retain information needed by the substantive analysis. If a cluster-level predictor is associated with individual outcomes, excluding those outcomes or their relevant cluster-level information may weaken compatibility with the analysis. But inserting every individual outcome as though it were an independent predictor of a cluster-level target is not automatically valid either. The model must account for members sharing a cluster, for example through an appropriate multilevel structure or carefully constructed cluster summaries. If such summaries are used, their sampling uncertainty matters.
A practical choice depends on the available variables and modeling goal:
| Approach | How the level-2 target is handled | Main caution |
|---|---|---|
| One-row-per-cluster imputation table | One target value and one draw per cluster | Member-level information must be represented appropriately if it is needed. |
| Multilevel conditional imputation model | Uses a model that recognizes members nested in clusters while generating a cluster-level value | Requires a suitable model and implementation; repeated target copies must not be treated as independent. |
| Independent row-wise imputation | Generates potentially different target values for members in the same cluster | Violates the cluster-level definition and can create pseudo-replication. |
The first two approaches are not interchangeable in every application. A cluster-only table is straightforward when its predictors adequately represent the information required. A multilevel model may be needed when the target’s conditional distribution depends on member-level data in ways that cannot be adequately captured by the chosen summaries. In either case, a level-2 draw is shared by the cluster’s members. The detailed modeling of missing values at each level is a separate problem; the point here is to keep the imputation unit aligned with the variable’s level.
Diagnostics and Common Failure Modes
After imputation, check the completed data rather than assuming that the software has preserved the intended structure. For every cluster, count the number of distinct nonmissing values of the level-2 variable. The count should be one. Also check that the variable’s missingness pattern is consistent within cluster before imputation, and that the join back to long data did not drop clusters or multiply rows.
- Different imputed values within a cluster: the target may have been imputed row by row, or cluster IDs may be inconsistent. Review the imputation unit and the ID construction.
- Too many imputation records: the long table may have been used directly as if each row were a cluster. Count unique cluster IDs and compare that count with the records used to fit the level-2 target model.
- Unexpected size weighting: compare summaries based on one record per cluster with summaries based on long rows. A large discrepancy can indicate that cluster size is implicitly weighting the model.
- Conflicting observed values: if one cluster has multiple observed categories or numeric values for a supposedly constant variable, do not resolve the conflict by selecting one arbitrarily. Investigate the coding, merge, or variable definition.
- Overconfident predictions: repeated copies do not create additional cluster-level information. Ensure that uncertainty reflects the number of clusters and the model used, rather than the number of member rows alone.
Worked Example: A Continuous Draw Shared Across Members
Suppose a hypothetical level-2 continuous variable \(Z_i\) is imputed from a cluster-level predictor \(W_i\). For a simplified illustration, assume the conditional model parameters are known:
For a cluster with \(W_i=1.5\), the conditional mean is \(10+2(1.5)=13\), and the conditional standard deviation is \(3\). Suppose a random-number draw for this cluster gives a standard-normal value of \(0.4\). Then:
If the cluster has four member rows, the completed long-format values are \(14.2, 14.2, 14.2, 14.2\). The draw is made once, not four times. This calculation illustrates the cluster-level propagation rule under a normal conditional model. In an actual chained-equation procedure, model parameters would generally also be estimated and their uncertainty represented; assuming known parameters here keeps the arithmetic focused on the unit of the draw.
The main limitation of the cluster-only representation is that it can discard useful within-cluster information if the imputation model needs that information. The main limitation of a multilevel alternative is that it requires a correctly specified and adequately supported model. Neither limitation justifies independent row-wise draws for a cluster-level variable. The definition of the target determines the consistency constraint; the modeling strategy determines how information and uncertainty are represented while respecting it.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A level-2 binary variable is missing for one school with 12 students. How many draws should be generated for that school in each imputed data set, and how should the completed value appear in long data?
- Two clusters have observed values \(Z_1=4\) and \(Z_2=10\), with sizes \(n_1=2\) and \(n_2=8\). Calculate the unweighted cluster mean and the row-weighted mean. What accounts for their difference?
- After imputation, one clinic has two distinct values of a supposedly clinic-level variable. Name two checks to make before treating this as a substantive result.
- Why might a multilevel conditional model be preferable to a one-row-per-cluster model, and what must it still avoid doing?
Solutions. (1) Generate one binary draw for the school. Copy that single value to all 12 student rows. (2) The cluster mean is \((4+10)/2=7\). The row-weighted mean is \((2(4)+8(10))/(2+8)=(8+80)/10=8.8\). The larger cluster receives more weight in the row-based calculation. (3) Check that cluster IDs are correctly constructed and that the variable is truly constant by definition; also inspect the imputation and join steps for independent row-wise draws or duplicated records. (4) It may use member-level information while representing members as nested within clusters. It must not treat repeated copies of the cluster-level target as independent measurements or generate inconsistent member-specific draws.