Tutorials › Multiple Imputation by Chained Equations (MICE) › Propagating Uncertainty In Variance Components in Multiple Imputation

Nested and Multilevel Data · Tutorial 364 of 497

Propagating Uncertainty In Variance Components in Multiple Imputation

Learn how variance-component uncertainty changes multilevel predictive distributions and why fixing variance estimates can produce imputations that are too certain.

Advanced 11 min read

What You'll Learn

  • Separate draws of variance components from draws of cluster random effects and residual errors.
  • Trace random-intercept variance uncertainty into a conditional parameter update.
  • Calculate how random-slope covariance matrices affect predictive variance at different predictor values.
  • Use the law of total variance to identify what plug-in imputation leaves out.
  • Recognize convergence, boundary, and identifiability problems in variance-component draws.
  • Compare full parameter draws with fixed fitted values and other uncertainty approximations.

Why Variance-Component Uncertainty Matters

In a multilevel imputation model, between-cluster variation is not just a feature of the fitted mean. It controls how much the imputed values can vary across clusters and, with random slopes, how that variation depends on a predictor. Treating an estimated variance component as known can therefore make imputations look more certain than the data support. The issue is especially consequential when there are few clusters or when the random-effects distribution is weakly identified.

A proper imputation must account for uncertainty in model parameters as well as uncertainty in the unobserved values. For the present topic, the key parameters include the random-effects covariance matrix and the residual variance. Drawing random effects while keeping their variance parameters fixed captures one source of predictive variation, but it does not represent uncertainty about those variance parameters themselves.

Definition: A variance-component draw is a draw of a model variance parameter, such as a random-intercept variance, a random-slope variance, a covariance between random effects, or a residual variance, from its distribution given the observed data and the current state of the imputation model. Propagating variance-component uncertainty means using these draws when generating the random effects and imputations, rather than treating fitted variance estimates as known constants.

Model and Sources of Variation

For a continuous variable being imputed, consider the two-level random-intercept and random-slope model

$$ Y_{ij}=x_{ij}^{\mathsf T}\beta+z_{ij}^{\mathsf T}b_j+\epsilon_{ij}, \qquad b_j\sim N(0,G), \qquad \epsilon_{ij}\sim N(0,\sigma^2). $$

Here \(i\) indexes individuals within cluster \(j\), \(x_{ij}\) contains fixed-effect predictors, \(z_{ij}\) contains the random-effect design variables, and \(b_j\) is the cluster-specific random-effect vector. The matrix \(G\) is its covariance matrix; \(\sigma^2\) is the within-cluster residual variance. Conditional on the model parameters and \(b_j\), residual errors are independent with mean zero and variance \(\sigma^2\). Random effects are independent across clusters and independent of residual errors. The model also requires a suitable conditional distribution for the imputed variable and predictors that make the relevant parameters identifiable.

For a random intercept and one random slope, \(z_{ij}=(1,x_{ij})^{\mathsf T}\), and

$$ G= \begin{pmatrix} \tau_0^2 & \tau_{01}\\ \tau_{01} & \tau_1^2 \end{pmatrix}. $$

The off-diagonal element is the intercept-slope covariance. It cannot be ignored merely because the two variances are of primary interest: it contributes to the variability of predictions at nonzero \(x_{ij}\). Every draw of \(G\) must be positive semidefinite; a draw with an invalid covariance matrix is not an admissible model draw.

In an imputation iteration, a parameter draw might be denoted \(\theta^{(m)}=(\beta^{(m)},G^{(m)},\sigma^{2(m)})\). Given the current completed-data state, the imputation procedure draws parameters from their appropriate conditional or posterior distribution, draws cluster effects conditional on those parameters and the cluster data, and then draws missing values from the resulting predictive distribution. The exact parameter sampler depends on the model and prior. A conditional update for one simple random-intercept model is derived below; it is not a universal update for every multilevel model.

A Conditional Variance Update

Suppose the model has random intercepts only, \(b_j\sim N(0,\tau^2)\), and suppose the current sampler state contains cluster effects \(b_1,\ldots,b_J\). Give \(\tau^2\) an inverse-gamma prior with shape \(a\) and scale \(c\), using density proportional to \((\tau^2)^{-a-1}\exp(-c/\tau^2)\). Conditional on the current random effects, their likelihood contributes \((\tau^2)^{-J/2}\exp[-\sum_j b_j^2/(2\tau^2)]\). Multiplying likelihood and prior gives

$$ \tau^2\mid b_1,\ldots,b_J \sim \operatorname{Inv\text{-}Gamma} \left(a+\frac{J}{2},\ c+\frac{1}{2}\sum_{j=1}^{J}b_j^2\right). $$

This is a conditional distribution within a sampler: the \(b_j\)'s are latent current draws, not observed cluster effects known without uncertainty. The complete procedure must also update the random effects and any other parameters. In models with random slopes, intercept-slope covariances, or different prior choices, the joint covariance matrix is typically sampled with a method respecting its constraints; independently drawing each matrix entry from the formula above would not generally be valid.

Worked Example: Updating a Random-Intercept Variance

Suppose a hypothetical Gibbs sampler has four current random-intercept draws, in outcome units, of \(0.2,-0.1,0.3,-0.2\). Use an inverse-gamma prior with shape \(a=2\) and scale \(c=0.5\). Find the conditional distribution of \(\tau^2\).

First calculate the sum of squared cluster effects: \(0.2^2+(-0.1)^2+0.3^2+(-0.2)^2=0.04+0.01+0.09+0.04=0.18\). Thus the updated shape is \(2+4/2=4\), and the updated scale is \(0.5+0.18/2=0.59\). Therefore

$$ \tau^2\mid b \sim \operatorname{Inv\text{-}Gamma}(4,0.59). $$

Under the stated shape-scale convention, the conditional mean is \(0.59/(4-1)=0.1967\) outcome-units squared. A sampler would draw a value from the full conditional distribution, not replace it by this mean. For illustration, a possible draw is \(\tau^2=0.12\) outcome-units squared; that one draw is not claimed to be the conditional mean or a summary of the entire distribution.

How Draws Enter Imputed Values

For a new cluster, conditional on a parameter draw \(\theta\), the random-effect contribution \(z^{\mathsf T}b\) has variance \(z^{\mathsf T}Gz\). Adding the independent residual variance gives

$$ \operatorname{Var}(Y\mid x,z,\theta)=z^{\mathsf T}Gz+\sigma^2. $$

For an existing cluster with observed outcomes, the random effect is informed by that cluster's data. Its conditional distribution is not generally \(N(0,G)\). If \(m_\theta\) is the conditional mean of the missing outcome given the observed cluster information and \(\theta\), and \(v_\theta\) is its conditional variance, then the predictive distribution across parameter draws obeys the law of total variance:

$$ \operatorname{Var}(Y_{\mathrm{mis}}\mid \text{observed data}) = E_\theta(v_\theta\mid \text{observed data}) + \operatorname{Var}_\theta(m_\theta\mid \text{observed data}). $$

The first term averages uncertainty remaining in the missing value at fixed parameters. The second captures variation in its conditional mean across parameter draws. Variance-component draws can change both: they change conditional predictive spread and can also change the distribution of a cluster effect given its observed data. This decomposition is a direct consequence of writing \(Y_{\mathrm{mis}}-E(Y_{\mathrm{mis}}\mid\text{data})\) as the sum of its deviation from its parameter-specific mean and the deviation of that mean from the overall mean. The cross-product has expectation zero conditional on the parameter draw, leaving the two displayed variance terms.

Worked Example: A Random Slope Changes Spread Across Predictor Values

Consider two hypothetical posterior draws of a random-intercept/random-slope covariance matrix, with predictor \(x\) measured in its stated units. Let \(G^{(1)}=\begin{pmatrix}0.25&0.04\\0.04&0.09\end{pmatrix}\) and \(G^{(2)}=\begin{pmatrix}0.49&0.12\\0.12&0.16\end{pmatrix}\), in squared outcome units or the corresponding covariance units. Both matrices are positive definite: their determinants are \(0.25(0.09)-0.04^2=0.0209>0\) and \(0.49(0.16)-0.12^2=0.0640>0\). Suppose the residual variance draw is \(\sigma^2=0.36\) outcome-units squared.

At \(x=0\), \(z=(1,0)^{\mathsf T}\), so the random-effect variance is the intercept variance: \(z^{\mathsf T}G^{(1)}z=0.25\) for the first draw and \(z^{\mathsf T}G^{(2)}z=0.49\) for the second. The total predictive variances are \(0.25+0.36=0.61\) and \(0.49+0.36=0.85\) outcome-units squared.

At \(x=2\), \(z=(1,2)^{\mathsf T}\). For the first draw, \(z^{\mathsf T}G^{(1)}z=0.25+2(2)(0.04)+4(0.09)=0.77\). For the second, \(z^{\mathsf T}G^{(2)}z=0.49+2(2)(0.12)+4(0.16)=1.61\). Adding the residual variance gives \(1.13\) and \(1.97\) outcome-units squared. The differences reflect both uncertainty in the variance components and the contribution of the intercept-slope covariance. Using only the random-intercept variance would miss how uncertainty in the random slope changes predictive spread with \(x\).

Worked Example: What Fixed Fitted Values Leave Out

For a hypothetical existing cluster, suppose two equally weighted parameter draws give conditional predictive means of \(10.2\) and \(10.6\) outcome units, with conditional predictive variances \(0.4\) and \(0.8\) outcome-units squared. These values summarize the conditional predictions after accounting for the cluster data under each draw.

The average conditional variance is \((0.4+0.8)/2=0.6\). The average mean is \((10.2+10.6)/2=10.4\), and the variance of the two conditional means is \(\{(10.2-10.4)^2+(10.6-10.4)^2\}/2=0.04\) outcome-units squared. Therefore the total predictive variance is \(0.6+0.04=0.64\) outcome-units squared.

If one instead fixes the parameters at a fitted value yielding mean \(10.4\) and variance \(0.6\), the calculation omits the \(0.04\) between-draw mean contribution. If one imputes only the fitted mean \(10.4\), it omits both terms and produces no predictive variation at all. Drawing residual errors but keeping variance components fixed can restore some individual-level variation, yet it still fails to represent uncertainty from the changing parameter draws.

Implementation, Checks, and Alternatives

A practical multilevel imputation iteration should preserve the connection between each variance-component draw and the random effects and missing values generated from it. The following sequence makes that dependency explicit.

1
Update model parameters.
Draw fixed effects, residual variance, and the random-effects covariance parameters using a sampler appropriate to the specified model and priors.
2
Update cluster effects.
Draw each cluster effect conditional on its observed and currently imputed outcomes and on the current covariance-parameter draw.
3
Generate missing values.
Use the current parameter and cluster-effect draws, and include the required residual or outcome-specific predictive draw rather than substituting a conditional mean.

The model assumptions need to be assessed at the level relevant to the imputation: the conditional outcome distribution and mean structure should be reasonable; the random-effects structure should represent the clustering and predictor-dependent variation; and the data should contain enough information to estimate the variance components. For likelihood-based inference under a missing-at-random assumption, the observed data and included predictors must also support that assumption. These conditions do not guarantee a well-behaved sampler, so numerical and substantive diagnostics remain necessary.

Inspect traces and distribution summaries for each variance and covariance parameter, as well as for imputed quantities and key analysis estimates. Persistent drift, chains stuck near zero, implausible extreme draws, or strong sensitivity to reasonable prior choices can indicate weak identification or poor mixing. Check that covariance draws satisfy positive-semidefiniteness and that random-slope variation is plausible across the observed predictor range. With few clusters, variance-component distributions can be broad or strongly skewed; a stable-looking fitted point estimate alone does not establish that uncertainty has been represented.

A common alternative is plug-in imputation: estimate the model once, hold \(\hat G\) and \(\hat\sigma^2\) fixed, and generate values using those estimates. This can preserve some predictive spread if random effects and residual errors are still drawn, but it conditions on the estimated variance components as though known. Conditional-mean imputation is more restrictive still: it replaces missing values by fitted means and does not generate residual variation. Parameter draws from an appropriate posterior are the direct approach when the model supports them; carefully designed bootstrap or other repeated-fit procedures can approximate parameter uncertainty, but they must respect the multilevel structure and covariance constraints.

Neither a parameter-drawing algorithm nor a large number of imputations repairs a misspecified random-effects structure, an uninformative design, or poor overlap in predictor values across clusters. Covariance estimates may be sensitive to priors when clusters are few, and a random-slope variance near zero can lie on the boundary of the parameter space. These are reasons to report and investigate uncertainty, not reasons to silently replace draws by a convenient point estimate.

Common Pitfall

Wrong reasoning: “I drew a random intercept for every cluster, so uncertainty in the random-intercept variance has already been included.” A random-effect draw conditional on a fixed \(\hat\tau^2\) includes variation prescribed by that fixed value, but it does not account for uncertainty about the value of \(\tau^2\). The correction is to draw the variance component as part of the parameter update and then generate random effects conditional on that draw. For random slopes, draw the covariance structure jointly or with a valid constrained method; varying separate entries without maintaining a valid covariance matrix is not a sound substitute.

Key takeaway: A multilevel imputation should carry variance-component uncertainty through the chain from parameter draws to cluster effects to missing values. Fixed fitted values suppress predictive variation, while fixed variance estimates can understate uncertainty even when random effects and residual errors are otherwise drawn.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. In the random-intercept update with \(a=1.5\), \(c=0.4\), \(J=6\), and \(\sum_j b_j^2=0.30\), what are the conditional inverse-gamma shape and scale?
  2. For \(z=(1,1)^{\mathsf T}\) and \(G=\begin{pmatrix}0.16&0.03\\0.03&0.04\end{pmatrix}\), calculate \(z^{\mathsf T}Gz\).
  3. State the two terms in the law of total variance for a missing outcome when parameters vary across draws, and explain what each represents.
  4. Why does drawing random effects from a distribution with fixed \(\hat G\) not fully propagate variance-component uncertainty?

Solutions. (1) The shape is \(1.5+6/2=4.5\); the scale is \(0.4+0.30/2=0.55\), so the conditional distribution is \(\operatorname{Inv\text{-}Gamma}(4.5,0.55)\). (2) The variance is \(0.16+2(0.03)+0.04=0.26\) outcome-units squared. (3) The terms are \(E_\theta(v_\theta\mid\text{data})\), the average conditional predictive variance, and \(\operatorname{Var}_\theta(m_\theta\mid\text{data})\), the variation in conditional means across parameter draws. (4) The random effects vary conditional on the one fixed covariance estimate, but the procedure never varies that covariance estimate to reflect its uncertainty.

Clinical Biostats