Tutorials › Multiple Imputation by Chained Equations (MICE) › Imputing Binary Cluster-Level Covariates

Nested and Multilevel Data · Tutorial 356 of 497

Imputing Binary Cluster-Level Covariates

You will learn to build and check a cluster-level logistic imputation model, draw missing values with parameter uncertainty, and propagate each draw consistently to all records in its cluster.

Advanced 12 min read

What You'll Learn

  • Represent the binary covariate once per cluster rather than as repeated independent person-level observations.
  • Choose cluster-level predictors and within-cluster summaries that preserve information relevant to the analysis.
  • Use a logistic model to calculate probabilities and draw a single binary value for each missing cluster.
  • Include uncertainty in both the model parameters and the binary imputations.
  • Diagnose sparse prediction, inappropriate summaries, and inconsistent record-level imputations.
  • Compare cluster-level logistic imputation with row-wise logistic imputation and complete-case analysis.

Why the Unit of Imputation Matters

Some variables belong to a cluster rather than to an individual within it. A hospital’s ownership type, a school’s funding category, or a clinic’s location may be measured once for the entire cluster. If such a variable is binary and missing for one cluster, the unknown value is the same for every record in that cluster. Imputation must preserve that structure.

The central modeling decision is therefore to treat the cluster—not each person or record—as the unit for the missing binary value. Cluster-level predictors and carefully selected summaries of level-1 information can help predict that value. The earlier material on cluster-level variables without replication establishes why the variable should be represented once; here the focus is on specifying and using a binary conditional model.

Definition: Let \(G_j\in\{0,1\}\) be a binary covariate measured once for cluster \(j\), where \(j=1,\ldots,J\). Let \(R_j=1\) if \(G_j\) is observed and \(R_j=0\) if it is missing. Cluster \(j\) contains \(n_j\) records. An imputation for a missing \(G_j\) is one draw shared by all \(n_j\) records in that cluster.

A Cluster-Level Logistic Imputation Model

Let \(Z_j\) denote cluster-level predictors, and let \(S_j\) denote selected summaries of variables measured on the cluster’s members. For example, \(S_j\) might include a cluster mean, proportion, or another summary chosen to retain information relevant to the substantive analysis. A standard conditional model for the binary covariate is

$$ \operatorname{logit}\{P(G_j=1\mid Z_j,S_j)\} =\beta_0+\boldsymbol{\beta}^{T}Z_j+\boldsymbol{\gamma}^{T}S_j, \qquad \operatorname{logit}(p)=\log\left(\frac{p}{1-p}\right). $$

The model gives a probability \(p_j\) for each cluster, with \(p_j=\operatorname{expit}(\eta_j)=1/(1+\exp(-\eta_j))\), where \(\eta_j=\beta_0+\boldsymbol{\beta}^{T}Z_j+\boldsymbol{\gamma}^{T}S_j\). The binary draw is then made at the cluster level: \(G_j^{\mathrm{mis}}\sim\operatorname{Bernoulli}(p_j)\). A value of one indicates the category coded as 1.

This conditional model rests on assumptions that should be made explicit. First, the logistic mean specification must be adequate: predictors, functional forms, and any needed interactions should represent the conditional relationship between \(G_j\) and the information used to impute it. Second, the cluster summaries must capture relevant information in the lower-level records; a single mean is not automatically adequate if the substantive analysis depends on other features of the within-cluster distribution. Third, missingness must be plausibly missing at random given the observed information used in the imputation, with a positive chance of observing \(G_j\) across the predictor patterns to which the model is applied. Finally, the model must respect the dependence structure between clusters; treating clusters as independent is suitable only when that is a reasonable assumption for the data and sampling design.

Include predictors of the binary covariate and variables used in the substantive analysis, where their values are available or have been imputed. If missingness may depend on cluster size, or cluster size is related to \(G_j\), consider including \(n_j\) when justified by the analysis and the missingness process. The level-1 summaries should likewise be chosen for a reason: for example, a cluster mean may retain between-cluster information, while a cluster proportion may be more appropriate for a binary level-1 measure. Their definitions should be consistent across clusters.

Worked Example: Calculating a Cluster’s Imputation Probability

Suppose a hypothetical fitted logistic model has a coefficient draw \(\beta_0=-1.2\), an urban-cluster coefficient of \(0.8\), and a coefficient of \(0.05\) per point of a cluster risk-score mean. For one cluster, the urban indicator is \(Z_j=1\) and the mean score is \(S_j=10\). Calculate its probability and illustrate a binary draw.

The linear predictor is

$$ \eta_j=-1.2+(0.8)(1)+(0.05)(10)=-1.2+0.8+0.5=0.1. $$

Thus

$$ p_j=\frac{1}{1+\exp(-0.1)}\approx 0.5250. $$

For an illustrative Bernoulli draw, generate \(U_j\sim\operatorname{Uniform}(0,1)\) and set \(G_j=1\) if \(U_j<p_j\), otherwise set \(G_j=0\). If \(U_j=0.41\), the draw is 1; if \(U_j=0.73\), it is 0. These are two possible outcomes from separate draws, not two values to assign within the same cluster. In multiple imputation, the coefficients should also be drawn to represent parameter uncertainty; this example holds the coefficient draw fixed only to show the probability calculation.

Drawing and Propagating Imputations

A practical chained-equations update uses the current completed values of the predictors and summaries to form one row per cluster for the target model. Fit the logistic conditional model using clusters with observed \(G_j\). Draw model parameters to reflect their estimation uncertainty, calculate \(p_j\) for each cluster with missing \(G_j\), and draw one Bernoulli value per such cluster. Keep observed \(G_j\) values fixed in this update. Finally, copy each imputed cluster value to all records belonging to that cluster before proceeding with the next update.

1
Construct the cluster-level predictors.
Use a single record per cluster for \(G_j\), its cluster-level predictors, and the chosen summaries. Calculate summaries from the current completed data when their component variables are incomplete.
2
Fit and update the logistic model.
Use clusters with observed \(G_j\) to estimate the conditional model, then draw coefficients using an appropriate parameter-uncertainty method. A coefficient draw followed by a binary draw is not the same as assigning the fitted probability as the imputed value.
3
Draw once per missing cluster and propagate.
Generate one binary value for each missing \(G_j\). Assign that same value to all records in cluster \(j\); do not independently draw values for the records.

Parameter uncertainty matters because the fitted coefficients are estimates, not known constants. For example, a large standard error in a coefficient means that plausible coefficient draws may yield materially different probabilities. The resulting variation across imputed data sets should include both this model uncertainty and the Bernoulli variation in the missing values. With few observed clusters or sparse categories, a simple large-sample coefficient approximation may be unreliable; the model and its uncertainty method need particular care.

Worked Example: Keeping Every Record in a Cluster Consistent

Consider three hypothetical clusters of sizes 2, 4, and 1. The first cluster’s binary covariate is observed as 1. The covariates for the second and third clusters give imputation probabilities 0.70 and 0.30 from the current parameter draw. For this illustration, the generated uniforms are 0.62 and 0.44.

For cluster 2, \(0.62<0.70\), so draw \(G_2=1\). For cluster 3, \(0.44\) is not less than \(0.30\), so draw \(G_3=0\). The cluster-level values are therefore \(G_1=1\), \(G_2=1\), and \(G_3=0\).

After propagation, the record-level values are \((1,1)\) for cluster 1, \((1,1,1,1)\) for cluster 2, and \((0)\) for cluster 3. The repeated entries are copies of one cluster value, not separate draws. In another imputed data set, cluster 2 might receive 0, but all four of its records would still receive the same value.

Why Row-Wise Duplication Gives the Wrong Likelihood

A cluster-level variable may appear on every row of a long data set because each record carries its cluster’s value. That data layout does not make those repeated entries independent observations of \(G_j\). The distinction can be seen directly from the likelihood.

Suppose, for illustration, a model gives a cluster probability \(p_j\), and cluster \(j\)’s observed value is \(G_j\). Its correct likelihood contribution is

$$ L_j=p_j^{G_j}(1-p_j)^{1-G_j}. $$

If the same response is mistakenly treated as \(n_j\) independent person-level responses, the contribution becomes

$$ L_j^{\mathrm{row}}= \left\{p_j^{G_j}(1-p_j)^{1-G_j}\right\}^{n_j}. $$

The incorrect expression counts one cluster’s information \(n_j\) times. It can make the fitted model appear far more certain than the actual number of observed clusters justifies.

Worked Example: Quantifying the Duplication Error

Suppose a hypothetical cluster has four records, its observed value is \(G_j=1\), and the model assigns \(p_j=0.70\). The correct contribution from this cluster is one Bernoulli likelihood contribution:

$$ L_j=0.70^1(1-0.70)^0=0.70. $$

If the value is incorrectly counted four times as independent, the contribution becomes

$$ L_j^{\mathrm{row}}=0.70^4=0.2401. $$

The difference is not evidence that the cluster gave four independent confirmations of \(G_j=1\). It is a consequence of the incorrect likelihood. The same error is even more striking for \(G_j=0\): the correct contribution is \(0.30\), while counting it four times gives \(0.30^4=0.0081\).

Summaries, Missing Components, and Diagnostics

Summaries used in the model can themselves depend on incomplete variables. In that case, calculate them from the current imputed values at each relevant update rather than treating a single summary calculated from incomplete records as fixed. This allows the uncertainty in the lower-level values to flow into the cluster-level prediction.

Worked Example: Updating a Summary From Incomplete Records

A hypothetical cluster has three member scores: 4, a missing value, and 10. Suppose the current imputation of the missing score is 6. The completed cluster mean is

$$ S_j=\frac{4+6+10}{3}=\frac{20}{3}\approx 6.667. $$

For a model with \(\eta_j=-2+0.3S_j+0.7Z_j\), and \(Z_j=1\), this gives

$$ \eta_j=-2+0.3(6.667)+0.7\approx 0.700, \qquad p_j=\frac{1}{1+\exp(-0.700)}\approx 0.6682. $$

If a different current imputation were 2, the mean would instead be \((4+2+10)/3=5.333\), changing the linear predictor to \(-2+0.3(5.333)+0.7=0.300\) and the probability to about 0.5744. The change illustrates why fixing a summary based only on observed scores would discard information about uncertainty in the completed data.

Useful diagnostics include the number of observed clusters in each category of \(G_j\), the spread of predicted probabilities, and whether fitted probabilities approach zero or one for predictor patterns that occur among clusters with missing values. Check for convergence warnings, separation, overly influential clusters, and implausibly large coefficient estimates. Also check the imputed data directly: within each cluster, every record should have exactly the same value of this cluster-level variable.

If a predictor pattern among missing clusters has no comparable observed clusters, predictions rely heavily on model extrapolation. Likewise, if almost all observed clusters have one category, the data may not support stable estimation of the logistic relationship. These are not problems that can be fixed simply by making more imputations. Revisit the predictor specification, consider whether a justified simpler model or suitable regularization is needed, and report the remaining uncertainty.

Alternatives and Common Pitfalls

Row-wise logistic regression is not an appropriate alternative when it treats repeated copies of \(G_j\) as independent outcomes: it inflates the contribution of large clusters. A multilevel logistic model designed for a binary outcome that varies among individuals is also not automatically suitable, because this target is one value per cluster. The relevant conditional model is defined on clusters; lower-level information enters through selected summaries or other appropriately constructed cluster-level predictors.

Complete-case analysis avoids imputing \(G_j\), but it discards clusters with missing values and can change the analysis population; it does not, by itself, resolve bias from missingness. A deterministic rule that assigns \(G_j=1\) whenever \(p_j>0.5\) also fails to represent uncertainty in the missing values. Cluster-level donor methods can be an alternative when comparable observed clusters exist, but they too require defensible matching information and must return one value per cluster.

  • Mistake: “There are four records, so the cluster’s missing binary value should be drawn four times.” Correction: the covariate is measured once per cluster, so make one draw and copy it to all four records.
  • Mistake: “A predicted probability of 0.70 is the imputed value.” Correction: \(0.70\) is a probability, not a binary category. Draw a binary value, and include uncertainty in the estimated model parameters.
  • Mistake: “Any cluster mean is a sufficient summary.” Correction: summaries must be selected to preserve information relevant to the substantive analysis. A mean can lose important information if the analysis depends on other aspects of the cluster’s member-level distribution.

The approach has limits. A cluster-level logistic model cannot recover information absent from observed clusters, and predictions can be unstable when there are few clusters, rare categories, or near-separation. Results can also depend on how summaries are defined and on whether the conditional model is compatible with the substantive analysis. Imputed values should therefore be interpreted as uncertain draws under a specified model, not as recovered facts.

Key takeaway: For a binary covariate measured once per cluster, model and draw at the cluster level. Use defensible cluster-level predictors and summaries, reflect model uncertainty, and propagate each imputed draw unchanged to every record in its cluster.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A cluster has six records and a missing covariate measured once for that cluster. How many binary values should be drawn, and what should happen to those values in the record-level data?
  2. A cluster has an imputation probability of 0.40 and its generated uniform value is 0.35. What is the binary draw under the rule used here?
  3. For an observed cluster with \(G_j=0\) and \(p_j=0.20\), state its correct Bernoulli likelihood contribution. What incorrect contribution would result from counting the same value three times as independent?
  4. Name two checks that could reveal an unstable logistic imputation model.

Solutions. (1) Draw one binary value for the cluster, then copy that same value to all six records. (2) Since \(0.35<0.40\), draw \(G_j=1\). (3) The correct contribution is \(p_j^0(1-p_j)^1=0.80\); the incorrect threefold contribution is \(0.80^3=0.512\). (4) Examples include checking for convergence warnings, separation or near-separation, rare observed categories, extreme fitted probabilities, and unusually large coefficient estimates.

Clinical Biostats