Overview
Ignoring clustering usually makes standard errors too small, so effects look more certain than they are. Aggregating everything to the group level throws away information and risks the ecological fallacy. Multilevel modeling — also called hierarchical linear modeling (HLM), mixed-effects or random-effects modeling — handles both problems by estimating within-group and between-group variation together.
We build models in a transparent sequence: an empty model to estimate the intraclass correlation, then level-1 and level-2 predictors, then random slopes and cross-level interactions where your hypotheses require them. At each step we compare models and record decisions on centering, estimation method and covariance structure.
The same framework handles longitudinal data, where repeated measurements are nested within individuals. Growth models estimate each person's trajectory and what predicts differences in starting points and rates of change, and they cope with unbalanced or partly missing time points better than repeated-measures ANOVA.
Who it’s for and the problems it solves
This is for you if you are…
- Education researchers with students nested in classrooms and schools
- Health researchers with patients in hospitals or repeated clinical measurements
- Organizational researchers with employees in teams or firms, including diary and experience-sampling studies
- Psychology and linguistics researchers with repeated trials per participant and item
Common problems we help with
- Your reviewer says your regression ignored clustering
- You are unsure whether to group-mean or grand-mean center your predictors
- The model with random slopes fails to converge or shows a singular fit
- You have only a small number of groups and are not sure multilevel modeling is appropriate
- You need to explain variance components and ICCs in your results chapter
What’s included — and what isn’t
Included
- Checking the data structure, number of levels, group sizes and whether multilevel modeling is warranted
- Null (empty) model and intraclass correlation coefficient
- Random-intercept models with level-1 and level-2 predictors
- Random-slope models and cross-level interactions
- Centering strategy (grand-mean, group-mean, or within/between decomposition) aligned with your research question
- Growth curve models for longitudinal data, including time coding and non-linear change
- Generalized linear mixed models for binary, count or ordinal outcomes
- Three-level and cross-classified models where the design requires them
- Model comparison with likelihood-ratio tests, AIC/BIC and pseudo-R² at each level
- Assumption checks on level-1 and level-2 residuals and influential groups
- Tables and code in R (lme4, glmmTMB), Stata (mixed, melogit), SPSS MIXED, HLM-style output or Mplus
Not included
- Adding random effects or dropping groups solely to obtain significant results
- Writing your chapters for submission — you receive explanations to write from
- Recommending a multilevel model when the design does not support it (for example, only three groups) without explaining the limitation
- Promising convergence for every model specification regardless of data
What you receive
- Model-building plan
- The sequence of models, centering choices, estimation method (ML or REML) and comparison criteria, agreed before analysis.
- Model comparison table
- Fixed effects with confidence intervals, variance components, ICC, fit statistics and variance explained for each model in the sequence.
- Figures
- Caterpillar plots of group effects, spaghetti plots of individual trajectories, and cross-level interaction plots.
- Reproducible code
- Commented R, Stata, SPSS or Mplus code, including data restructuring from wide to long format.
- Interpretation notes
- What each fixed and random effect means for your hypotheses, and how to describe the multilevel structure in your methods.
How it works
Map the structure
We identify levels, group counts, sizes and which variables belong at which level.
Plan the sequence
We agree the model-building steps, centering and estimation approach with you.
Prepare data
We restructure files where needed, create group means or aggregated variables and check missingness.
Estimate and compare
We fit and compare models, resolving convergence issues with justified simplifications.
Report and explain
Tables, plots and code, followed by a walkthrough and follow-up questions.
Key modeling choices
- Intraclass correlation
- The share of outcome variance lying between groups; it shows how much clustering matters and is reported from the empty model.
- Centering
- Group-mean centering separates within-group from between-group effects; grand-mean centering adjusts for level-1 predictors when level-2 effects are the focus. The choice changes the meaning of coefficients.
- Random slopes
- Allow the effect of a level-1 predictor to vary across groups; required before testing cross-level interactions and often recommended to avoid overconfident fixed effects.
- Estimation
- Restricted maximum likelihood (REML) for variance components, ML for comparing models with different fixed effects, Kenward–Roger or Satterthwaite corrections for small numbers of groups.
- Generalized mixed models
- Logistic, Poisson or ordinal mixed models for non-continuous outcomes, with the latent-variable ICC where appropriate.
- Growth models
- Time as a level-1 predictor with random intercepts and slopes, linear or polynomial or piecewise change, and level-2 predictors of trajectories.
Do you actually need a multilevel model?
Multilevel models are most useful when you have a reasonable number of groups and questions about group-level effects or variation. With very few groups (say, fewer than about 10–20, depending on the question), variance components are estimated poorly, and a fixed-effects approach with group dummies or cluster-robust standard errors may be more honest. We look at your design and tell you which approach fits and why.
If your interest is only in controlling for clustering, rather than modeling it, cluster-robust standard errors or generalized estimating equations (GEE) can be simpler alternatives.
Convergence problems and singular fits
Complex random-effect structures often fail to converge or produce variance estimates of zero (a 'singular fit'). The data may simply not contain enough information to estimate every variance and covariance. We try different optimizers, rescale predictors and, where necessary, simplify the random structure in a principled way, reporting what was attempted so readers can judge.
For designs with crossed random effects, such as participants and stimuli in experiments, we set up cross-classified models rather than averaging over one factor.
Interpretation and limits
We report fixed effects with confidence intervals, variance components with their meaning in the original units, and the proportion of variance explained at each level. Level-2 predictors observed rather than randomized still carry the usual risk of confounding, and group-level associations should not be read as individual-level ones.
We also check level-1 and level-2 residuals for normality and look for influential groups, since a single unusual school or clinic can drive a between-group effect.
What the work can look like
Illustrative example — fictional data
Sample excerpt: reading scores across schools
An education researcher analyzed reading scores for 2,340 pupils in 58 schools, asking whether pupil-level home reading and school-level library provision predict scores. All figures are invented.
Empty model
ICC = .17, meaning 17% of the variance in reading scores lay between schools, enough to justify a multilevel model.
Final model
Group-mean-centered home reading predicted scores within schools, b = 2.4, 95% CI [1.9, 2.9]. School library provision predicted school means, b = 3.1, 95% CI [0.8, 5.4]. The random slope for home reading was retained, variance = 0.62, likelihood-ratio χ²(2) = 11.8, p = .003.
Wording
The school-level association is described as an association between schools, not evidence that improving an individual school's library will raise individual pupils' scores by the same amount.
Illustrative example with invented numbers, not a real client project.
What you’ll need to provide
- Research questions, noting which are about individuals and which are about groups
- The anonymized dataset with group identifiers at each level
- Details of measures and when they were collected (for longitudinal designs)
- Any group-level data such as school or clinic characteristics
- Software preference and reporting requirements
You don’t need everything ready to ask for a quote — tell us what you have and we’ll say what’s missing.
What affects price and turnaround
Price depends on
- Number of levels and whether random effects are crossed
- Number of models in the building sequence
- Outcome type (continuous versus binary, ordinal or count)
- Data restructuring and merging of individual- and group-level files
- Delivered analysis versus guided sessions
Turnaround depends on
- Complexity of the data structure and whether IDs are consistent across files
- Time spent resolving convergence problems
- How quickly model-building decisions can be agreed with you
Every project is quoted individually. How we price our work.
Questions people ask before starting
How many groups do I need?
It depends on what you want to estimate. Fixed effects can be reasonably estimated with fewer groups than variance components and cross-level interactions, which need more. We assess your design and explain the trade-offs rather than applying a single rule.
Is HLM software required?
No. HLM is one program; the same models can be fitted in R, Stata, SPSS MIXED, Mplus or SAS. We use the software that suits you and label output in the terms your field uses.
Can repeated-measures data be analyzed this way?
Yes. Growth and repeated-measures mixed models treat time points as nested in individuals and handle unequal spacing and missing waves better than repeated-measures ANOVA.
My model gives a singular fit warning. Is it wrong?
Not necessarily, but it means some variance components are estimated at or near zero. We investigate, simplify where justified and explain how to report it.
Will you write up the methods and results?
We provide model tables, plots and explanations and can check your draft. The thesis text is yours, and you should acknowledge assistance as required.