- Introduced by
- Raudenbush & Bryk (popularized); Goldstein (parallel development)
- Year
- 1986
- Type
- Parametric nested-data regression
What does it do?
Hierarchical Linear Modeling (HLM), also known as Multilevel Modeling (MLM), is a parametric regression method for data with a nested or clustered structure, such as students within classrooms, patients within hospitals, or repeated measurements within individuals.
The framework was developed in the 1980s and popularized by Raudenbush and Bryk, whose 2002 text is cited here as a standard reference. HLM estimates effects at the individual and group levels within one model and partitions outcome variance between those levels.
The intuition behind the method
Standard regression treats every observation as independent, but when your data are grouped — say 500 students spread across 30 schools — observations within the same group tend to resemble each other. Ignoring that clustering understates standard errors and can produce false significance. HLM solves this by fitting a model at each level: one equation describes individuals within groups, and a second describes how those individual-level parameters vary across groups. The result is a single, coherent model that respects the data's natural hierarchy.
History
The framework grew out of random-effects modeling and was formalized in the mid-1980s (facts year 1986). Stephen Raudenbush and Anthony Bryk popularized it, and their 2002 text is cited here as a standard reference. Harvey Goldstein developed parallel multilevel methodology in the UK. Joop Hox's Multilevel Analysis (2nd ed., 2010) is cited here as a practical reference.
When to use it
Choose HLM when observations are nested within groups and the outcome varies meaningfully between those groups. A useful first check is the ICC from the intercept-only (null) model. An ICC above 0.05 is a rough screening signal that clustering may matter, but it is not a formal threshold. Clustering can affect inference at smaller ICCs when groups are large, so the design effect 1 + (n̄−1)×ICC should be checked before the multilevel model is dropped. When the ICC is near zero and the design effect is negligible, ordinary regression with cluster-robust standard errors may suffice. Typical designs include students in schools, patients in clinics, repeated measurements within individuals, and employees within teams. Do not use HLM when the data have only one level or when there are too few groups to estimate the variance components. The base form assumes a continuous outcome, approximately normal random effects, and Level-1 residuals that are independent conditional on those random effects. For ordinal, count or binary outcomes, the multilevel extensions covered by Hox (2010) are needed. Groups should contain a reasonable number of observations, preferably at least 5 per group.
Limitations and considerations
- Needs a reasonable number of groups; with few Level-2 units, the random-effect variances and the standard errors that depend on them are imprecise.
- Deciding which coefficients are fixed and which are random is a substantive choice, and wrong specifications can change conclusions.
- Requires more computation than OLS, and models with many random slopes can fail to converge.
- Cross-level interactions need clear theoretical grounding, since their meaning depends on how predictors are centered and what the group-level variables represent.
- The assumptions need checking. Residuals should be roughly normal with similar spread across groups, the estimated random effects should look approximately normal, and each random slope should be justified. Diagnostic plots, such as residuals by group and estimated group effects, should be inspected before the variance components are interpreted.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Respects the non-independence of observations within groups, which otherwise tends to inflate Type I error in standard regression.
- Estimates predictors at the individual and group levels in one model and allows cross-level interaction terms, such as a group-level predictor moderating an individual-level slope.
- Does not require equal group sizes, so unbalanced clusters can be analyzed directly.
- Reports the ICC and random-effect variances, which quantify how much outcome variation lies between groups.
Applications
- Educational research: modeling student achievement as a function of individual characteristics (Level 1) and school-level factors such as class size or teacher experience (Level 2).
- Clinical and epidemiological research: estimating treatment effects in multi-site trials where patients are nested within hospitals or clinics.
- Longitudinal studies: treating repeated measurements as Level-1 units nested within individuals (Level 2), capturing individual growth trajectories.
- Organizational behavior: partitioning variance in employee outcomes into individual and team or organizational sources.
- Cross-national survey research: modeling individual attitudes nested within countries, with country-level predictors at Level 2.
How it works
How it works
The null hypothesis states that a given fixed slope, such as the effect of one predictor on the outcome (labelled γ10 in the model), is zero in the population of groups; the alternative states that it is not. Random effects, which describe how much intercepts or slopes vary between groups, are a separate question. They are assessed with a likelihood-ratio comparison of nested models rather than with the fixed-effect test.
Formula
H_0:\ \gamma_{10} = 0 \quad H_1:\ \gamma_{10} \neq 0The model equation in this step is a random-intercept form: the outcome for individual i in group j equals a fixed intercept plus a fixed slope times predictor X, plus a group-specific random intercept u0j and a residual eij, both assumed normal with variances τ² and σ². In a full two-level specification, the level-1 and level-2 equations are written separately and then combined into a single reduced equation for estimation. The group-level intercept (and optionally the slope) can also be modeled as a function of group-level predictors plus error. Fixed effects (γ) describe average relationships, while the variance components (τ², σ²) describe between-group and within-group variation. The test statistic for a fixed slope is the Wald statistic t = γ̂10 / SE(γ̂10), the estimate divided by its estimated standard error. In large samples it is referred to a standard normal (z) distribution. With few groups, software commonly uses a t distribution with degrees of freedom from an approximation such as Satterthwaite or Kenward–Roger; the method used should be reported. The likelihood-ratio statistic, described in the decision step, is used to compare nested models.
Formula
Y_{ij} = \gamma_{00} + \gamma_{10}X_{ij} + u_{0j} + e_{ij}, \quad u_{0j} \sim \mathcal{N}(0,\tau^2),\quad e_{ij} \sim \mathcal{N}(0,\sigma^2)The ICC, τ²/(τ² + σ²), gives the share of total variance attributable to group membership. Individual fixed effects are tested with Wald tests (t or z statistics). Nested models are compared with the likelihood-ratio test (LRT). The decision rule is to reject H0 when p < 0.05. An LRT that compares models with different fixed effects requires full maximum likelihood (ML) estimation, whereas REML is preferred for estimating variance components. The Wald test is the default for individual fixed effects and does not require ML. Reporting should include fixed-effect estimates with confidence intervals, random-effect variances (τ²), and the ICC. The 0.05 ICC cut-off mentioned elsewhere is a rough screening heuristic, not a formal test.
Formula
\text{ICC} = \frac{\tau^2}{\tau^2 + \sigma^2};\quad \text{reject } H_0 \text{ if } p < 0.05 \text{ (LRT or Wald)}Common pitfalls
- Fitting the multilevel model without first computing the ICC from the null model; if clustering is negligible, the multilevel structure adds complexity without a clear benefit.
- Reporting fixed effects without the random-effect variances (τ²), which hides how much group-level variability remains.
- Working with very few groups (fewer than about 10), where variance estimates are unreliable.
- Centering predictors without deciding between grand-mean and group-mean centering; the two change the meaning of the coefficients.
- Testing variance components with a standard likelihood-ratio test without considering the boundary of the parameter space, since variances cannot be negative, which makes the usual reference distribution approximate.
- Using the normal (z) reference for Wald tests when there are few groups, which can make p-values too small. Small-sample degrees-of-freedom corrections, such as Satterthwaite or Kenward–Roger where the software offers them, should be used and reported.
Frequently asked questions
How do I know if I need HLM rather than ordinary regression?
Start by fitting the null (intercept-only) model and computing the ICC. An ICC above 0.05 is a rough screening signal that a meaningful share of variance lies between groups, which conflicts with the independence assumption of OLS. The 0.05 value is a heuristic, not a formal threshold. Even smaller ICCs can matter when groups are large, because the design effect 1 + (n̄−1)×ICC inflates standard errors. Check the design effect before deciding.
How many groups do I need?
The number of Level-2 units (groups) governs the precision of random-effect estimates. A commonly cited rule of thumb is 20–30 groups for reliable variance component estimation. This is approximate, and the required number depends on group size and model complexity. With 10–20 groups, estimates should be interpreted with caution. With fewer than about 10, random-effect estimates are unstable, and Bayesian or fixed-effects alternatives may be worth considering.
What is the difference between a random intercept and a random slope model?
A random intercept model allows each group's baseline level of the outcome to differ, while keeping the relationship between predictors and the outcome the same across groups. A random slope model additionally allows the strength (slope) of that relationship to vary by group. Random slope models are richer but require more data and are harder to estimate; adding them is only warranted when theory or exploratory analysis suggests the effect genuinely varies across groups.
Should I use maximum likelihood (ML) or restricted maximum likelihood (REML)?
Use REML when the primary goal is estimating random-effect variances, because it produces less-biased variance components. Use full ML when comparing models that differ in their fixed effects via the likelihood-ratio test, because REML likelihoods are not comparable across models with different fixed parts.
Related methods
Sources
Raudenbush, S.W. & Bryk, A.S. (2002). Hierarchical Linear Models: Applications and Data Analysis Methods (2nd ed.). Sage.
ISBN: 978-0761919049Hox, J.J. (2010). Multilevel Analysis: Techniques and Applications (2nd ed.). Routledge.
Open DOI reference