- Introduced by
- Anthony Bryk and Stephen Raudenbush
- Year
- 1992
- Type
- Method
- Family
- hierarchical-data-analysis
What does it do?
Multilevel modeling, also called hierarchical linear modeling or mixed-effects modeling, is a regression framework for data with nested or clustered structure, such as students within schools, patients within hospitals, or repeated measures within individuals.
It models the dependence among observations within the same cluster and partitions outcome variance between levels, so that individual-level and cluster-level predictors can be estimated in one model. Bryk and Raudenbush's 1992 textbook Hierarchical Linear Models is a standard reference for the approach, alongside Goldstein's book on multilevel statistical models.
The intuition behind the method
Standard regression assumes that observations are independent, but clustered data break this assumption: students in the same school tend to resemble each other more than students in different schools. If this dependence is ignored, standard errors are typically too small, confidence intervals too narrow, and false positives more likely. A multilevel model estimates variance at each level (for example, within-school and between-school variance), lets regression coefficients vary across clusters through random slopes, and uses cluster-level characteristics to predict how within-cluster relationships differ. The result represents both individual effects and context effects, and its tests account for the clustering.
History
Bryk and Raudenbush's 1992 textbook Hierarchical Linear Models is the reference most often cited for popularising these models in education and social research; the underlying ideas predate that book. Goldstein's work on multilevel statistical models, also cited above, extended the methodology to more complex hierarchies. Software implementations such as lme4, nlme, MLwiN and HLM made multilevel analysis widely accessible.
When to use it
Use multilevel modeling when observations are nested or repeatedly measured within units, such as students in schools, patients in hospitals, employees in organisations, repeated measures within subjects, or family members within families. It is most needed when the outcome varies meaningfully between clusters, which the ICC helps to show. When clustering appears negligible, a simpler model may be adequate, but the thresholds in the literature are conventions and should not be applied as a single cut-off. The method is also useful for cluster-specific predictions, such as risk-adjusted hospital outcomes, because random effects shrink noisy cluster estimates toward the overall mean. Do not rely on it when there are very few clusters, since random-effect estimates will be unstable; in that case, consider a simpler design or a different analysis.
Limitations and considerations
- Needs enough level 2 clusters: as a rule of thumb, with fewer than about 10 clusters random-effect variances are unreliable, and about 30 or more is preferred for stable estimates.
- Assumes that cluster membership is defined in advance. When units belong to two groupings at once (for example, students linked to both schools and neighbourhoods), a cross-classified model is needed, which is more complex to fit.
- Standard errors and p-values rely on large-sample approximations, so they are less reliable with few clusters; bootstrap or permutation tests are alternatives.
- Specification is demanding: deciding which slopes vary and at which level is a substantive choice, and omitting a needed random slope can yield biased fixed-effect estimates.
- Standard estimation assumes normally distributed random effects; departures at level 2 can bias estimates, so residuals at each level should be checked.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Accounts for nonindependence, so standard errors and confidence intervals reflect the clustering in the data rather than treating each observation as independent.
- Separates within-cluster and between-cluster variance, showing whether differences lie among individuals inside clusters or among the clusters themselves.
- Produces shrunken (empirical Bayes) estimates of cluster-specific intercepts and slopes, which are more stable than unpooled cluster estimates when cluster sizes are small or uneven.
- Does not require equal cluster sizes, so unbalanced designs can be analysed in the same model.
- Represents three or more levels, such as students within schools within districts, in a single model.
Applications
- Educational research: modelling student achievement with students nested in classrooms or schools, and quantifying school and teacher effects.
- Medical research: modelling patient outcomes such as mortality or readmission with patients nested in hospitals, and risk-adjusting hospital-specific rates for quality comparisons.
- Longitudinal studies: modelling change over time with repeated measures (level 1) nested in individuals (level 2), including growth curves and trajectory models.
- Organisational research: modelling employee outcomes such as satisfaction or performance with employees nested in teams, departments or organisations.
- Family studies: modelling child behaviour with siblings (level 1) nested in families (level 2), where family-level characteristics such as socioeconomic status or parenting predict sibling similarity.
How it works
How it works
Start by mapping the hierarchy: level 1 units (individuals, observations or time points) nested within level 2 clusters (schools, hospitals, families), and optionally level 3 units (organisations or districts). Record a continuous outcome, level 1 predictors that vary within clusters, level 2 predictors that vary between clusters, and the cluster identifier. The linear model described here assumes a continuous outcome; binary outcomes require a generalized linear mixed model (for example, a multilevel logistic model), which is estimated by approximation methods such as Laplace or adaptive quadrature rather than the REML procedure described below. Check the number of level 2 clusters: as a rule of thumb, fewer than about 10 clusters makes random-effect variances unreliable, and about 30 or more is preferred for stable estimates. Estimate the intraclass correlation (ICC) from an unconditional model with no predictors; an ICC above 0.05 is often used as a guideline for justifying a multilevel analysis, but it is a convention rather than a formal test. For longitudinal data, time points (level 1) are nested within individuals (level 2), which may be nested within groups (level 3).
Fit the model by restricted maximum likelihood (REML), which is generally preferred when comparing random-effects structures, or by maximum likelihood (ML), which is used for likelihood ratio tests of fixed effects. Write the level 1 model as Y_ij = β₀j + β₁j(X_ij) + ε_ij, where i indexes individuals and j indexes clusters. Write the level 2 model as β₀j = γ₀₀ + γ₀₁(Z_j) + u₀j, which specifies how intercepts vary across clusters. Report the fixed effects (the γ coefficients), the random-effect variances (u₀j, u₁j), the ICC as τ₀₀ / (τ₀₀ + σ²), where τ₀₀ is the between-cluster variance and σ² is the within-cluster residual variance, information criteria (AIC, BIC) for comparing models, and likelihood ratio tests between nested models.
Fixed effects describe average relationships across clusters. For example, a fixed slope of 0.5 means that, on average, a one-unit increase in the predictor is associated with a 0.5-unit increase in the outcome, after accounting for clustering. For a linear model, the random-effect variances are on the squared scale of the outcome. The random intercept variance shows how much baseline outcomes differ between clusters, and the random slope variance shows whether the effect of a predictor differs across clusters. A cross-level interaction coefficient is read as the change in the level 1 slope per one-unit increase in the level 2 predictor. The ICC gives the share of total variance lying between clusters: an ICC of 0.30 means 30% of the variance is between clusters, and 0.05 means 5%. For binary outcomes the ICC requires a latent-scale definition and is not computed as above. Cluster-specific intercepts and slopes (shrinkage estimates) describe context-specific effects, but they are pulled toward the average, most strongly for small or noisy clusters. To compare nested models, compute −2 × (log-likelihood of the simpler model − log-likelihood of the more complex model) and refer it to a χ² distribution with degrees of freedom equal to the difference in the number of parameters.
Common pitfalls
- Ignoring clustering: treating clustered observations as independent typically understates standard errors and inflates false positives.
- Using raw cluster means in place of individual values mixes within-cluster and between-cluster information. Centre level 1 predictors on the group mean to separate the two effects, and enter the cluster mean as a level 2 predictor.
- Random slopes with few clusters: estimating a random slope for every predictor when there are few clusters gives unstable estimates. Keep slopes fixed where theory does not require variation, or use penalised estimation.
- Cross-level interactions: an interaction between a level 1 and a level 2 predictor means the level 1 effect depends on cluster context. Interpret it by plotting predicted slopes across the range of the level 2 predictor, not by reading the main coefficient alone.
- Selecting models by p-values alone: compare nested models with likelihood ratio tests or AIC and BIC, since stepwise selection is unreliable with random effects.
- Skipping diagnostics: examine level 1 and level 2 residuals for normality, constant variance and outliers, because violations may call for transformation or robust methods.
Frequently asked questions
What is the intraclass correlation (ICC), and why does it matter?
The intraclass correlation (ICC) is the correlation between observations in the same cluster, equivalently the proportion of total variance attributable to clustering: ICC = between-cluster variance / total variance. An ICC of 0 means no clustering, and an ICC of 1 means all variation lies between clusters. Some texts use rules of thumb such as ICC above 0.10 for strong clustering, 0.05 to 0.10 for moderate, and below 0.05 for weak; these are conventions, not tests. A small ICC can still inflate standard errors when clusters are large, so it should not be ignored on its own. Calculate the ICC from the unconditional model (no predictors) to assess baseline clustering. Shrout and Fleiss (1979) introduced intraclass correlations for reliability studies; the variance-partition use in multilevel models follows from the multilevel textbooks.
What is the difference between fixed effects and random effects?
Fixed effects are average relationships across clusters, for example the average effect of age on the outcome across schools. Random effects are cluster-specific deviations from that average, for example how each school's age effect differs from the overall mean. A random intercept lets the baseline outcome differ by cluster, and a random slope lets the effect of a predictor differ by cluster. Include a random effect when clusters differ substantively in that quantity; use a fixed effect when the relationship is conceptually the same across clusters. Random-effect variances quantify heterogeneity, and a large variance indicates that the effect differs substantially between clusters.
How do I choose between REML and ML estimation?
REML (restricted maximum likelihood) is usually preferred when comparing random-effects structures, such as models with and without random slopes, because it gives less biased variance-component estimates than ML, particularly with few clusters. ML is needed for likelihood ratio tests that compare models differing in their fixed effects. With large samples the two methods give similar estimates. Always report which method was used, since results can differ, especially in small samples.
What is the difference between grand-mean centering and group-mean centering?
Grand-mean centering subtracts the overall mean from a predictor, so the intercept refers to the outcome at the average predictor value. Group-mean centering subtracts each cluster's mean, which separates within-cluster from between-cluster effects; the cluster mean is then entered as a level 2 predictor, representing a composition effect. For example, centering student socioeconomic status within school isolates the within-school association, while school mean socioeconomic status captures differences between schools. Choose the form that matches the within-versus-between question, and check which centering your software applies by default rather than assuming it.
Related methods
Sources
Bryk, A. S., & Raudenbush, S. W. (1992). Hierarchical Linear Models: Applications and Data Analysis Methods. SAGE Publications.
Open DOI referenceGoldstein, H. (2011). Multilevel Statistical Models (4th ed.). Wiley-Blackwell.
Open DOI referenceShrout, P. E., & Fleiss, J. L. (1979). Intraclass correlations: Uses in assessing rater reliability. Psychological Bulletin, 86(2), 420–428.
Open DOI reference