Author-reviewedEvidence: highv1.0.0

Hierarchical Model

A hierarchical model represents observations or parameters at multiple related levels and estimates variation within and between those levels.

Last reviewed byDr Darrin Baines

Concept Architecture

Hierarchical Model: Concept Architecture

Keep linked observations together

A hierarchical model represents data or parameters at more than one related level, such as patients within hospitals or studies within an evidence synthesis. This page shows the group structure, how partial pooling uses information across groups, and how the model can support cost-effectiveness decisions without erasing genuine differences.

Identify the levels and the outcome

Specify the observation unit and the grouping units before fitting a model. Patients treated at the same hospital may share staffing, prices, clinical practice, and case mix; their outcomes are therefore not necessarily independent. Likewise, treatment-effect estimates from different trials have study-level variation in addition to their sampling error.

For a continuous patient outcome YijY_{ij} for patient ii in hospital jj, a simple random-intercept model can be written as:

Yij=αj+βxij+εij,αj∼N(μ,τ2),εij∼N(0,σ2).Y_{ij}=\alpha_j+\beta x_{ij}+\varepsilon_{ij}, \qquad \alpha_j\sim N(\mu,\tau^2), \qquad \varepsilon_{ij}\sim N(0,\sigma^2).

Here xijx_{ij} is a measured patient characteristic, β\beta its conditional association, αj\alpha_j a hospital-specific intercept, τ2\tau^2 between-hospital variance, and σ2\sigma^2 residual within-hospital variance. The normal distributions are illustrative modelling choices, not requirements of every hierarchical model. Binary events can instead use an appropriate link and likelihood; skewed positive costs may require another outcome family. Research on multicentre economic evaluation explains why patient, centre, and country structure can affect costs and outcomes.

See how partial pooling works

Estimating each hospital wholly separately can make a small hospital's estimate very noisy. Treating every hospital as identical can hide genuine differences. Partial pooling estimates a shared distribution of hospital effects and draws imprecise group estimates toward the overall mean, with the amount determined by within-group information and between-group variation.

For a normal-means teaching case with known overall mean μ\mu, between-group variance τ2\tau^2, common patient-level variance σ2\sigma^2, group sample size njn_j, and group sample mean yˉj\bar y_j, the posterior or empirical-Bayes point estimate under the stated assumptions is:

α^j=μ+wj(yˉj−μ),wj=τ2τ2+σ2/nj.\widehat\alpha_j =\mu+w_j(\bar y_j-\mu), \qquad w_j=\frac{\tau^2}{\tau^2+\sigma^2/n_j}.

When njn_j is small, σ2/nj\sigma^2/n_j is larger and the estimate receives more shrinkage toward μ\mu. When between-group differences τ2\tau^2 are large relative to sampling error, the group data retain more influence. The expression illustrates the mechanism; real analyses must estimate uncertain variances and account for covariates and outcome distributions. An applied hospital performance study explains why low-volume hospital estimates can shrink most.

Work through two hospitals

Suppose a hypothetical outcome has an overall mean of 5, a known between-hospital variance of 1, and a patient-level variance of 25. Hospital A has 10 patients and an unadjusted mean of 10; its weight is 1/(1+25/10)=2/7≈0.2861/(1+25/10)=2/7\approx0.286, producing 5+(2/7)(10−5)≈6.435+(2/7)(10-5)\approx6.43. Hospital B has 100 patients and an unadjusted mean of 7; its weight is 1/(1+25/100)=0.81/(1+25/100)=0.8, producing 5+0.8(7−5)=6.65+0.8(7-5)=6.6.

A's apparently higher raw mean is more heavily pulled toward the common mean because it comes from fewer observations. The example is arithmetic for an assumed normal model, not a hospital ranking or a quality judgment. A real comparison would adjust for patient risk, uncertainty in the shared parameters, sampling and outcome definitions, and the costs of false classifications.

Choose the hierarchy needed for the decision

A patient–hospital hierarchy can estimate clustering, contextual effects, and variation in costs or health outcomes. A study-level random-effects meta-analysis is also hierarchical: each study estimates its own underlying effect, while those effects are related through a distribution. A Bayesian implementation specifies prior distributions for its hyperparameters; frequentist mixed-effects approaches also represent multiple levels without using the same prior formulation.

The levels need not be a simple nesting. Patients may receive care at several providers, or repeated outcomes may be nested within people who are also grouped by country. Cross-classified, longitudinal, or multivariate models may be needed when the data structure demands them. A cluster-trial cost-effectiveness application shows how a hierarchy can jointly represent costs and effects; multinational cost-data research illustrates a non-normal cost model.

Diagnose the model rather than trusting shrinkage

Inspect group sizes, residual patterns, influential groups, the estimated between-group variance, and whether predicted observations resemble the actual data. Test sensitivity to the chosen random-effects distribution, prior when Bayesian, patient covariates, and whether group effects or treatment effects are allowed to vary. A model can pool biased observations efficiently and still be biased.

Shrinkage is not evidence that a small hospital truly performs near average. If important groups are unlike the population used for pooling, exchangeability may fail; separate strata or explanatory group characteristics may be more defensible. Uncertainty around group estimates and group rankings should be presented, especially when decisions affect payments, access, or reputations.

Carry group differences into economic decisions

For cost-effectiveness, decide whether the question concerns an average across all sites or a specific local population. A hierarchical analysis can propagate variation and uncertainty in costs, outcomes, treatment effects, and incremental net benefit across centres. It should separate between-centre heterogeneity from uncertainty about a pooled mean and from within-patient variation, then use appropriate local prices and practice patterns.

Report the levels, likelihood, link, covariates, varying terms, distribution or priors, group sizes, fit checks, and target population. Do not mistake statistical levels for a clinical state-transition hierarchy or an ontology parent-child relationship. The value of the model comes from matching its structure and assumptions to the actual evidence and decision.

Library

Publications

1
  • Book

    Statistical Analysis of Cost-Effectiveness Data — Willan & Briggs, 1st Edition ed., 2006 (John Wiley & Sons)

    A synthesis of statistical methods for analysing cost-effectiveness data, including net-benefit regression, confidence intervals for the ICER, cost-effectiveness acceptability curves, and covariate adjustment. Part of the Wiley Statistics in Practice series.

Frequently Asked Questions (6)

  • What is a hierarchical model?

    A modelling approach representing nested data, such as patients within hospitals, allowing effects to vary at each level while borrowing statistical strength.

    Source: Goldstein 2011

  • How does a hierarchical model represent nested data?

    A hierarchical model represents data that come in nested layers, such as patients grouped within hospitals, by allowing effects to vary at each level rather than treating every observation as independent. It estimates variation both between individuals and between the groups they belong to, and it lets groups borrow strength from one another, so a small group's estimate is pulled toward the overall average where its own data are sparse. This gives more stable estimates and correctly reflects the layered structure. Modelling variation at each nested level is its purpose. Kirkwood and Sterne (2003) describe such models.

    Source: Kirkwood & Sterne 2003

  • How does a hierarchical model work?

    A hierarchical model works by including random effects for the higher-level units, so that, for example, each hospital has its own random deviation from the overall average, and the model estimates both the fixed effects of predictors and the variation between units at each level. This accounts for within-group correlation and allows information to be shared across groups. So a hierarchical model works by modelling variation at multiple levels through random effects, which handles the nested structure of the data, estimates how much outcomes vary between groups, and borrows strength so that estimates for small groups are informed by the overall pattern, improving their stability.

    Source: Goldstein 2011

  • Why are hierarchical models used?

    Hierarchical models are used because nested data violate the assumption of independence, since observations within the same group are correlated, and ignoring this leads to incorrect standard errors; hierarchical models account for the structure, giving valid inference. They also allow variation at each level to be examined and strength to be borrowed across groups. So hierarchical models are used to analyse nested data correctly and informatively, since they handle the within-group correlation, quantify variation at different levels, and produce more stable estimates for small groups, which is why they are standard for data organised in levels, such as patients within clinics or measurements within individuals.

    Source: Goldstein 2011

  • What does borrowing strength mean in a hierarchical model?

    Borrowing strength in a hierarchical model means that the estimate for each group is informed by that group's own data together with the data from other groups, through the shared distribution of the random effects, so that estimates for small or noisy groups are pulled toward the overall average, improving their stability. So borrowing strength refers to the way a hierarchical model combines group-specific and overall information, shrinking unreliable individual-group estimates toward the general pattern, which yields more stable and often more accurate estimates for groups with little data than analysing each group separately would, a key advantage of the multilevel approach.

    Source: Goldstein 2011

  • What are examples of hierarchical models?

    Examples of hierarchical models include random intercept models, where each group has its own baseline level; random slope models, where the effect of a predictor also varies between groups; and models with more than two levels, such as patients within wards within hospitals. They apply to continuous, binary, and other outcomes through generalised forms. So hierarchical models encompass a range of specifications for nested data, from simple random intercepts to complex multilevel structures with varying effects, all sharing the feature of modelling variation at multiple levels, which allows them to be adapted to the particular hierarchy and outcome type of the data being analysed.

    Source: Goldstein 2011

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 25 Sep 2026

Content version: 1.0.0

Canonical Identity

Term code
HE-ES-SA-077

Stable URI · Machine-readable · Resolvable · CC BY 4.0