Bayesian Hierarchical Model with Missing Data

Statistics
Introduced by
Gelman, Rubin, Little (and collaborators)
Year
1990s–2000s
Type
Bayesian hierarchical model with missing-data integration
Family
Bayesian / computational

What does it do?

A Bayesian hierarchical model with missing data treats unobserved values as additional unknowns and samples them jointly with all model parameters from the posterior.

The nested structure of the hierarchy borrows strength across groups, while the Bayesian framework naturally propagates uncertainty from missingness through every estimate and prediction.

The intuition behind the method

Imagine student test scores measured across many schools, where some scores were never recorded. Rather than deleting those students or substituting a single imputed value, the model treats each missing score as an unknown quantity with its own probability distribution. The hierarchical structure means a missing student's plausible score range is informed both by their own school's average and by the overall population, and every downstream estimate — school means, treatment effects, predictions — honestly reflects that extra uncertainty.

History

The foundation of Bayesian missing-data analysis was laid by Rubin's (1976) missing-data taxonomy and formalised in Little and Rubin's Statistical Analysis with Missing Data. The data-augmentation algorithm connecting MCMC to missing-data imputation was introduced by Tanner and Wong (1987). Gelman and colleagues' Bayesian Data Analysis integrated these ideas into the hierarchical modeling framework, and tools such as Stan, JAGS, and Blimp have made the approach practical in applied research. The approach developed gradually from these ideas rather than originating with a single paper.

When to use it

Use this approach when data are nested within groups and missingness is non-trivial, especially when the missing-data fraction varies across groups and complete-case analysis would lose too many observations. It is particularly valuable when missingness is at random (MAR) and the covariates that predict missingness are already in the model. Avoid it when missingness is likely MNAR and you have no credible model for the missingness mechanism, since the posterior will be sensitive to unverifiable assumptions. For very large datasets with minimal missingness, simpler imputation followed by standard multilevel models may be adequate.

Limitations and considerations

  • Computationally demanding: the joint posterior over parameters and all missing values may require long MCMC chains, especially in large datasets.
  • Results under MNAR are sensitive to untestable assumptions about the missingness mechanism.
  • Model specification becomes complex when missingness affects multiple variables with different types (binary, continuous, count).
  • The between-group variance (τ²) is often weakly identified when there are few groups, so the prior placed on it can strongly affect estimates for groups with heavy missingness. Prior choice and convergence diagnostics therefore need expert attention, since poor choices lead to unreliable posteriors.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Integrates imputation and estimation in one coherent model, avoiding the separate combining rules of multiple imputation.
  • Hierarchical partial pooling borrows strength across groups, improving estimates for groups with sparse or highly missing data.
  • Full posterior uncertainty propagates through every estimate and prediction, including uncertainty from missingness.
  • Under MAR with distinct missingness and outcome parameters, no separate missingness model is needed for inference, provided the model includes the observed variables that predict missingness.
  • Flexible: extends to non-normal outcomes, time series, and MNAR sensitivity analyses.

Applications

  • Longitudinal studies with participant dropout, where missingness is predicted by prior observed measurements.
  • Multi-site clinical trials where some sites have incomplete outcome records and patient-level data are nested within sites.
  • Educational data analysis with missing test scores across schools, using hierarchical pooling to stabilise school-level estimates.
  • Survey research with item non-response, jointly modelling responses and missingness using respondent background variables.
  • Ecological or monitoring studies in which some sites or years have missing counts, modelled with site-level random effects, where missingness is plausibly related only to observed site characteristics.

How it works

How it works

1

The analysis starts by stating the missing-data mechanism: missing completely at random (MCAR), missing at random (MAR), or missing not at random (MNAR). Formally, the observed-data likelihood involves integrating over the missing values, p(Y_obs, M | θ, φ) = ∫ p(M | Y_obs, Y_mis, φ) p(Y_obs, Y_mis | θ) dY_mis. Under MAR, when the parameters governing missingness (φ) are distinct from the outcome parameters (θ), this factorizes as p(M | Y_obs, φ) p(Y_obs | θ), and the missingness model can be ignored when estimating θ. Under MNAR, a model for the missingness itself must be included alongside the outcome model, and the outcome parameters are not identified by the observed data alone.

Formula
p(Y_{obs}, M \mid \theta, \phi) = \int p(M \mid Y_{obs}, Y_{mis}, \phi)\, p(Y_{obs}, Y_{mis} \mid \theta)\, dY_{mis} = p(M \mid Y_{obs}, \phi)\, p(Y_{obs} \mid \theta) \text{ under MAR}
2

The hierarchical likelihood is specified for the complete data, both observed and missing. In a two-level model, outcomes within groups follow a likelihood with group-level parameters, which in turn follow a population-level distribution. This partial pooling borrows information across groups to stabilise estimates, particularly helpful when some groups have many missing observations. The displayed equations use a scalar τ² for simplicity (for example a random-intercept model); with several group-level coefficients, β_j is a vector with a covariance matrix Σ in place of τ². Hyperparameters need priors: weakly informative choices such as half-normal or half-Student-t priors on the standard deviations τ and σ are common defaults. When the number of groups is small, check how results change under alternative priors for τ.

Formula
y_{ij} \mid \beta_j, \sigma^2 \sim \mathcal{N}(X_{ij}\beta_j, \sigma^2),\quad \beta_j \mid \mu, \tau^2 \sim \mathcal{N}(\mu, \tau^2)
3

Data augmentation treats each missing value as an additional latent variable. Under ignorable missingness (MAR with distinct parameters) the joint posterior over all parameters and all missing values is proportional to the complete-data likelihood times the priors; otherwise a factor for the missingness model must be included. Imputation and parameter estimation happen simultaneously rather than in separate steps, so no multiple-imputation combining rules are needed.

Formula
p(\theta, Y_{mis} \mid Y_{obs}) \propto p(Y_{obs}, Y_{mis} \mid \theta)\, p(\theta)
4

The marginal posterior over the model parameters is obtained by integrating out the missing values. In practice this integral is never evaluated analytically; instead, MCMC samplers (Gibbs, Hamiltonian Monte Carlo / NUTS) draw missing values from their conditional predictive distributions, p(Y_mis | Y_obs, θ), and parameters from their conditional posteriors, p(θ | Y_obs, Y_mis), yielding a single coherent posterior sample. Note that HMC/NUTS cannot sample discrete missing values directly; these must be marginalised out or handled by another scheme.

Formula
p(\theta \mid Y_{obs}) = \int p(\theta, Y_{mis} \mid Y_{obs})\, dY_{mis}
5

After confirming MCMC convergence via R-hat and effective sample size, posterior summaries — means, medians, credible intervals — for all parameters incorporate the full uncertainty from both the model and the missing observations. Posterior predictive checks assess whether the imputed data and model predictions are consistent with the observed data distribution.

Common pitfalls

  • Assuming MAR without checking: if the data are MNAR, the posterior is biased and sensitivity analyses are essential.
  • Omitting from the model the variables that predict missingness. MAR concerns the data-generating process, not the model: if missingness depends on an observed variable that is left out of the imputation model, the analysis is biased even when the data are in fact MAR.
  • Reporting point estimates from the posterior without credible intervals, hiding the inflation of uncertainty due to missingness.
  • Skipping posterior predictive checks on the imputed values, leaving model misspecification undetected.
  • Treating convergence as guaranteed — always inspect R-hat and trace plots when missing-data augmentation is involved.

Frequently asked questions

How does this differ from standard multiple imputation followed by multilevel modeling?

Multiple imputation (MI) separates imputation from analysis and uses Rubin's combining rules to pool estimates across imputed datasets. The Bayesian approach performs both simultaneously in one posterior, avoiding approximate combining rules and naturally propagating all uncertainty. With large samples and simple models the two methods give similar answers; the Bayesian approach is more coherent and more flexible for complex hierarchical structures.

Can I use this method when data are missing not at random (MNAR)?

Yes, but you must specify an explicit model for the missingness mechanism — for example a selection model or pattern-mixture model. MNAR parameters are not identified by the observed data alone, so the posterior is sensitive to prior assumptions. Sensitivity analyses over plausible MNAR models are essential before drawing conclusions.

What MCMC sampler should I use?

Hamiltonian Monte Carlo (HMC/NUTS, implemented in Stan) is generally preferred for continuous parameters because it explores the posterior efficiently and provides reliable convergence diagnostics. Gibbs sampling (for example in JAGS) is an alternative for conditionally conjugate models. Always run multiple chains and check R-hat values below 1.01 and adequate effective sample size.

How do I check whether my imputation is sensible?

Use posterior predictive checks: draw replicated datasets from the posterior (including imputed values) and compare their distribution to the observed data. Check that imputed values fall in plausible ranges and that patterns across groups are consistent with domain knowledge. Also examine whether results change substantially if complete cases only are used, as a sensitivity check.

Does the model require the missing data fraction to be small?

No. The Bayesian framework handles high missing-data fractions, but with more missing data the posterior will be wider and more prior-dependent. When missingness is very high in some groups, posterior estimates for those groups will rely heavily on the hierarchical pooling from other groups and on the prior, so transparent reporting of this dependence is important.

Related methods

Sources

  1. Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A. & Rubin, D. B. (2013). Bayesian Data Analysis (3rd ed.). CRC Press.

    ISBN: 978-1439840955
  2. Little, R. J. A. & Rubin, D. B. (2002). Statistical Analysis with Missing Data (2nd ed.). Wiley.

    ISBN: 978-0471183860