BackgroundContext and objective
Contents: problem context, survey design, variables and research questions.
Problem context
Students’ mathematics achievement varies substantially across schools: in some schools most students score high, in others many still struggle to meet the competency standards.
The institution wants to know why. Is the variation mainly due to individual student characteristics (prior ability, socioeconomic status, study time), or also to the school environment (facility quality, teacher experience)?
Students in the same school share facilities, academic environment and teachers, so their scores tend to be similar and are not independent. Treating all students as independent would ignore school information.
Survey design
A survey randomly selected 30 schools, then 30 students from each (900 students). The data have a two-level hierarchy: students nested in schools.
| Level | Variable | Description |
|---|---|---|
| 1 · Student | math_score (Y) | Mathematics test score |
| 1 · Student | prior_score | Mathematical ability before instruction |
| 1 · Student | ses | Socioeconomic conditions of the family |
| 1 · Student | study_hours | Average weekly hours studying mathematics |
| 1 · Student | gender | Male / Female |
| 2 · School | facility | Quality of learning facilities |
| 2 · School | teacher_exp | Mathematics teachers’ years of experience |
Research questions
- How much variation is attributable to differences between students, and how much to differences between schools?
- Can student characteristics explain differences in achievement?
- Can school characteristics explain differences across schools?
- After accounting for both, do between-school differences remain unexplained?
Why a multilevel model?
Intraclass correlation violates the independence assumption of OLS: standard errors of school-level variables become too small. Here ICC = 0.082 and the design effect = 1 + (30 − 1)·ICC = 3.38.
Method: linear mixed models with a random school intercept (REML for estimation, ML for LRT/AIC/BIC). See the Models tab for M1–M4.
Analysis workflow
- EDA and data checks
- Null model → ICC (Q1)
- M2 student predictors (Q2)
- M3 school predictors + robustness (Q3)
- Residual τ₀₀ test (Q4)
- M4 random slope, diagnostics, conclusions
Objective
To help the institution decide whether interventions should be directed primarily toward individual students, the school environment, or both. Use the tabs above: Overview for a quick picture, Models to understand each model, and the Q1–Q4 tabs for each question.
OverviewQuick picture
Contents: key indicators and core charts. Result: variation is mainly between students (92%), yet schools still matter (8%).
1Variance
8.2% of score variation is between schools, 91.8% between students.
2Students
SES, prior ability, study hours and gender are significant. σ² falls 99%.
3Schools
teacher_exp is robust (4/4), facility inconsistent (1/4). τ₀₀ falls another 16%.
4Residual variance
Between-school differences remain (p < 0.001).
Map of 30 schools × 30 students
One column = one school, one dot = one student. Hover over a dot.
Variance composition (null model)
Schools account for 8.2% of total variance, the basis for a multilevel model.
Variance explained by each model (%)
Student predictors explain almost all of σ²; the remaining school variance is handled by level-2 variables.
Fixed effects of Model 3 by level (solid = significant)
Green = student level, yellow = school level; all effects per 1 SD.
Model comparison (AIC and BIC, ML)
M4 is much better than M3 (ΔAIC = 262).
ModelsWhat each model is
Contents: what each model (M1–M4) is, its equation, why it is fitted, and its results, plus supporting models. Result: M1 gives the ICC, M2–M3 add predictors, M4 adds a random slope.
Overview of the models
| Model | Type | Formula | Answers | Key result |
|---|---|---|---|---|
| M1 Null | Random intercept (no predictors) | math ~ 1 + (1 | school) | Q1: how much variance is between schools | ICC = 0.082 |
| M2 Student | Random intercept + level-1 predictors | math ~ prior + ses + study + gender + (1 | school) | Q2: do student traits explain scores | σ² ↓ 98.6% |
| M3 Full | Random intercept + level-1 and level-2 predictors | M2 + facility + teacher_exp | Q3 and Q4: do school traits explain school differences; what remains | τ₀₀ ↓ 38.2%; residual τ₀₀ p < 0.001 |
| M4 Final extension | M3 + random slope for study_hours | M3 + (1 + study_hours | school) | Extra: does the study-hours effect vary by school | slope SD 0.38; LRT p < 0.001 |
All models are linear mixed models fitted by REML; ML fits are used for likelihood-ratio tests, AIC and BIC. Predictors are z-scored (level-1 over 900 students, level-2 over 30 schools), so coefficients are effects per 1 SD.
Model 1: Null (unconditional) model
What it is. A model with only an intercept and a random school intercept. It has no predictors; every school gets its own average score u₀ⱼ around the grand mean γ₀₀.
Why we fit it. To split the total score variance into a between-school part (τ₀₀) and a within-school, between-student part (σ²). Their ratio is the ICC and shows whether a multilevel model is needed at all.
u0j ~ N(0, τ00), eij ~ N(0, σ²)
Result. γ₀₀ = 77.79, τ₀₀ = 3.165, σ² = 35.408, ICC = 0.082, design effect = 3.38. About 8.2% of variation is between schools.
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.787 | 0.381 | 204.38 | <0.001*** | 77.041 ; 78.533 |
ML fit: log-likelihood -2901.2 · AIC 5808.4 · BIC 5822.8 · 3 parameters
Model 2: Student-level predictors
What it is. Model 1 plus the four student characteristics as fixed effects (prior_score, ses, study_hours, gender). The intercept is still allowed to vary by school.
Why we fit it. To test whether individual traits explain score differences (Question 2). Comparing σ² with Model 1 shows how much within-school variance they explain.
Result. σ² falls 35.41 → 0.507 (98.6% explained); τ₀₀ falls 26.1%. All four predictors are significant; SES is the strongest.
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.588 | 0.281 | 275.92 | <0.001*** | 77.037 ; 78.139 |
| prior_score (z) | 2.345 | 0.024 | 97.40 | <0.001*** | 2.298 ; 2.392 |
| ses (z) | 5.382 | 0.024 | 222.93 | <0.001*** | 5.335 ; 5.430 |
| study_hours (z) | 0.333 | 0.024 | 13.83 | <0.001*** | 0.286 ; 0.380 |
| gender: male | 0.421 | 0.048 | 8.72 | <0.001*** | 0.327 ; 0.516 |
ML fit: log-likelihood -1042.9 · AIC 2099.7 · BIC 2133.3 · 7 parameters
Model 3: Student + school predictors (main model)
What it is. Model 2 plus the two school-level variables, facility and teacher_exp, which are identical for all students in a school.
Why we fit it. To test whether school characteristics explain differences across schools (Question 3) and to check how much school variance remains afterwards (Question 4, residual τ₀₀).
+ γ01·facilityj + γ02·teacherj + u0j + eij
Result. τ₀₀ falls 2.340 → 1.957 (16.3% additional). teacher_exp is significant, facility is not. Residual τ₀₀ is still significant (p < 0.001).
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.588 | 0.258 | 301.26 | <0.001*** | 77.083 ; 78.093 |
| prior_score (z) | 2.345 | 0.024 | 97.40 | <0.001*** | 2.298 ; 2.392 |
| ses (z) | 5.382 | 0.024 | 222.94 | <0.001*** | 5.335 ; 5.430 |
| study_hours (z) | 0.332 | 0.024 | 13.81 | <0.001*** | 0.285 ; 0.380 |
| gender: male | 0.422 | 0.048 | 8.73 | <0.001*** | 0.327 ; 0.516 |
| facility (z) | 0.478 | 0.274 | 1.74 | 0.081 | -0.059 ; 1.015 |
| teacher_exp (z) | 0.702 | 0.274 | 2.56 | 0.010* | 0.166 ; 1.239 |
ML fit: log-likelihood -1039.1 · AIC 2096.3 · BIC 2139.5 · 9 parameters
Model 4: Random slope for study_hours
What it is. Model 3 where the effect of study hours is also allowed to differ between schools, via a random slope u₃ⱼ that is correlated with the random intercept.
Why we fit it. Model 3 fails the homoscedasticity check across schools. The random slope absorbs the extra school-specific spread and tests whether study hours work equally well everywhere.
(u0j, u3j) ~ N(0, T), T = [τ00, τ03; τ03, τ33]
Result. LRT vs Model 3 = 265.8 (p < 0.001); slope SD = 0.38, ρ = 0.96; σ² falls to 0.365. Homoscedasticity is restored.
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.575 | 0.252 | 308.27 | <0.001*** | 77.081 ; 78.068 |
| prior_score (z) | 2.341 | 0.021 | 113.67 | <0.001*** | 2.301 ; 2.382 |
| ses (z) | 5.376 | 0.021 | 259.66 | <0.001*** | 5.335 ; 5.416 |
| study_hours (z) | 0.310 | 0.073 | 4.24 | <0.001*** | 0.167 ; 0.453 |
| gender: male | 0.467 | 0.041 | 11.28 | <0.001*** | 0.386 ; 0.548 |
| facility (z) | 0.385 | 0.108 | 3.57 | <0.001*** | 0.174 ; 0.595 |
| teacher_exp (z) | 0.457 | 0.112 | 4.08 | <0.001*** | 0.237 ; 0.676 |
ML fit: log-likelihood -906.3 · AIC 1834.5 · BIC 1887.3 · 11 parameters
Supporting models and checks
| Model / check | Purpose | Result |
|---|---|---|
| OLS (no random effect) | Baseline that treats all students as independent | SE of facility and teacher_exp are 5.1× and 5.1× too small |
| Cluster-robust OLS | Robustness of school effects without random effects | teacher_exp p = 0.004; facility p = 0.094 |
| Two-stage regression | Regress adjusted school means on school variables | teacher_exp p = 0.016; facility p = 0.092 |
| Leave-one-school-out (30 refits of M3) | Is a finding driven by a single school? | teacher_exp significant in 29/30; facility in 2/30 |
| Random-slope screening (ses, prior, study) | Which effects vary by school | Only study_hours (LRT 265.8) |
| Contextual model | Adds school means of ses, prior, study (exploratory) | τ₀₀ 1.957 → 1.787 |
Why multilevel? SE of OLS vs multilevel (M3)
OLS shrinks the standard errors of school-level variables, giving overconfident conclusions.
Data & EDAData exploration
Contents: data structure, quality, descriptives and spread. Result: no missing values; school scores clearly differ; ses correlates most with scores (r = 0.89).
Data structure: two levels
| Level | Unit | Variables |
|---|---|---|
| 1 | Student (i) | math_score (Y), prior_score, ses, study_hours, gender |
| 2 | School (j) | facility, teacher_exp (identical for all students in a school) |
Students are nested in schools, so scores within a school are correlated. OLS ignores this and understates the standard errors of school-level variables. The impact is measured by the design effect = 1 + (m − 1)·ICC.
Data quality
| Check | Result |
|---|---|
| Rows | 900 |
| Missing values | 0 |
| Duplicate rows | 0 |
| Schools | 30 |
| Students per school | 30 |
| Distinct facility/teacher_exp values per school (must be 1) | 1 |
No missing values, so no imputation is needed. Level-1 predictors are z-scored over 900 students, level-2 predictors over 30 schools (coefficients = effect per 1 SD).
Descriptive statistics
| Variable | Mean | SD | Min | Max |
|---|---|---|---|---|
| math_score | 77.79 | 6.20 | 57.9 | 95.9 |
| prior_score | 64.83 | 10.01 | 31.3 | 95.0 |
| ses | 49.58 | 12.20 | 16.9 | 83.9 |
| study_hours | 7.93 | 2.51 | 1.0 | 16.1 |
| facility | 69.54 | 10.11 | 47.1 | 91.0 |
| teacher_exp | 9.36 | 3.01 | 3.5 | 15.0 |
| Gender | n | Mean | SD |
|---|---|---|---|
| Male | 425 | 77.97 | 6.42 |
| Female | 475 | 77.62 | 6.00 |
Correlations, VIF and sums of squares
| math_score | prior_score | ses | study_hours | facility | teacher_exp | |
|---|---|---|---|---|---|---|
| math_score | 1.00 | 0.38 | 0.89 | 0.06 | 0.03 | 0.10 |
| prior_score | 0.38 | 1.00 | 0.01 | -0.02 | -0.03 | -0.00 |
| ses | 0.89 | 0.01 | 1.00 | 0.02 | -0.00 | 0.02 |
| study_hours | 0.06 | -0.02 | 0.02 | 1.00 | 0.02 | 0.03 |
| facility | 0.03 | -0.03 | -0.00 | 0.02 | 1.00 | -0.30 |
| teacher_exp | 0.10 | -0.00 | 0.02 | 0.03 | -0.30 | 1.00 |
| Variable | VIF |
|---|---|
| prior_score_z | 1.002 |
| ses_z | 1.001 |
| study_hours_z | 1.002 |
| gender_male | 1.001 |
| facility_z | 1.104 |
| teacher_exp_z | 1.104 |
All VIF ≈ 1: no multicollinearity. facility–teacher_exp correlation (30 schools): -0.304. Sum of squares: between schools 10.9%, within schools 89.1%.
Distribution of math scores
Score spread per school (box = Q1–Q3, dot = median)
School medians differ clearly: a sign of a school variance component.
Scores by gender (box = Q1–Q3, dot = median)
Mean: male 78.0, female 77.6.
Sum-of-squares decomposition
ANOVA view: share of total variation lying between vs within schools.
School mean score vs facility
r = 0.10, p = 0.600
School mean score vs teacher_exp
r = 0.31, p = 0.095
School mean score vs school mean ses
r = 0.73, p < 0.001
Predictors vs math score (interactive)
Predictor:
math_score vs prior_score
math_score vs ses
math_score vs study_hours
math_score vs facility
VarianceBetween students vs schools
Contents: variance decomposition with the null model (M1). Result: ICC = 0.082, design effect = 3.38.
Question 1How much of the variation in students’ mathematics achievement is attributable to differences between students, and how much to differences between schools?
Variance decomposition (M1 Null)
Null model (random intercept)
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.787 | 0.381 | 204.38 | <0.001*** | 77.041 ; 78.533 |
| Component | Value |
|---|---|
| τ₀₀ (school variance) | 3.165 |
| σ² (student variance) | 35.408 |
| ICC | 0.0821 |
| LRT vs OLS | 35.59 (p < 0.001) |
| Design effect (m = 30) | 3.38 |
| SS between / within | 10.9% / 89.1% |
Student traitsLevel-1 effects
Contents: Model 2 with student predictors. Result: σ² falls 99%; SES is strongest.
Question 2Can individual student characteristics, such as prior mathematics ability, socioeconomic status, and study time, explain differences in mathematics achievement?
Model 2: student predictors
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.588 | 0.281 | 275.92 | <0.001*** | 77.037 ; 78.139 |
| prior_score (z) | 2.345 | 0.024 | 97.40 | <0.001*** | 2.298 ; 2.392 |
| ses (z) | 5.382 | 0.024 | 222.93 | <0.001*** | 5.335 ; 5.430 |
| study_hours (z) | 0.333 | 0.024 | 13.83 | <0.001*** | 0.286 ; 0.380 |
| gender: male | 0.421 | 0.048 | 8.72 | <0.001*** | 0.327 ; 0.516 |
Student-level effects (solid = significant)
Gender: male minus female.
School traitsLevel-2 effects
Contents: Model 3, joint test and robustness of school effects. Result: teacher_exp is robust, facility is inconsistent.
Question 3Can school-level characteristics, such as the quality of school facilities and teacher experience, explain differences in mathematics achievement across schools?
Model 3: students + schools
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.588 | 0.258 | 301.26 | <0.001*** | 77.083 ; 78.093 |
| prior_score (z) | 2.345 | 0.024 | 97.40 | <0.001*** | 2.298 ; 2.392 |
| ses (z) | 5.382 | 0.024 | 222.94 | <0.001*** | 5.335 ; 5.430 |
| study_hours (z) | 0.332 | 0.024 | 13.81 | <0.001*** | 0.285 ; 0.380 |
| gender: male | 0.422 | 0.048 | 8.73 | <0.001*** | 0.327 ; 0.516 |
| facility (z) | 0.478 | 0.274 | 1.74 | 0.081 | -0.059 ; 1.015 |
| teacher_exp (z) | 0.702 | 0.274 | 2.56 | 0.010* | 0.166 ; 1.239 |
Fixed effects of M3 by level
Robustness: four specifications
| Specification | Variable | Coef. | SE | p | Sig. 5% |
|---|---|---|---|---|---|
| M3: random intercept | facility (z) | 0.478 | 0.274 | 0.081 | No |
| M3: random intercept | teacher_exp (z) | 0.702 | 0.274 | 0.010 | Yes |
| M4: + slope study_hours | facility (z) | 0.385 | 0.108 | <0.001 | Yes |
| M4: + slope study_hours | teacher_exp (z) | 0.457 | 0.112 | <0.001 | Yes |
| OLS + school-clustered SE | facility (z) | 0.477 | 0.285 | 0.094 | No |
| OLS + school-clustered SE | teacher_exp (z) | 0.703 | 0.245 | 0.004 | Yes |
| Two-stage (regression on 30 school means) | facility (z) | 0.478 | 0.274 | 0.092 | No |
| Two-stage (regression on 30 school means) | teacher_exp (z) | 0.702 | 0.274 | 0.016 | Yes |
Coefficients by specification
Leave-one-school-out (30 scenarios): p-values
| facility coef. | facility p | teacher_exp coef. | teacher_exp p | |
|---|---|---|---|---|
| min | 0.150 | 0.022 | 0.382 | 0.0028 |
| mean | 0.474 | 0.103 | 0.699 | 0.0180 |
| max | 0.586 | 0.621 | 0.769 | 0.2059 |
teacher_exp stays at p<0.05 in 29/30 scenarios; facility in 2/30.
Leave-one-school-out: coefficients
The teacher_exp coefficient is stable; facility varies more depending on which school is dropped.
Residual varianceAnything left?
Contents: residual school variance test and school effects. Result: 62% of τ₀₀ remains and is significant.
Question 4After accounting for both student-level and school-level characteristics, do differences in mathematics achievement between schools remain unexplained?
Caterpillar plot M3 (û₀ⱼ ± 1.96 conditional SE)
29 of 30 schools differ significantly from the average school (red). SD of school effects = 1.40. Conditional SE = 0.129 (approximation).
Variance decomposition across models
Formal tests
| Test | Statistic | p |
|---|---|---|
| Q1: M1 vs OLS | 35.59 | <0.001 |
| Q3: M2 vs M3 (2 df) | 7.44 | 0.024 |
| Q4: M3 vs OLS | 1205.19 | <0.001 |
| Q4 in M4: random-effects block | 1471.0 | <0.001 |
Study-hours slopeExtra finding (M4)
Contents: Model 4 with a random study-hours slope. Result: the study-hours effect differs between schools (SD 0.38).
Random-slope tests (ML)
| Random slope | LRT | p (df = 2) | Slope variance |
|---|---|---|---|
| ses (z) | 0.03 | 0.984 | 0.0010 |
| prior_score (z) | 0.00 | 1.000 | 0.0008 |
| study_hours (z) | 265.79 | <0.001 | 0.1415 |
Only study_hours is significant; the effects of ses and prior_score can be treated as equal across schools.
Model 4: M3 + random slope for study_hours
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.575 | 0.252 | 308.27 | <0.001*** | 77.081 ; 78.068 |
| prior_score (z) | 2.341 | 0.021 | 113.67 | <0.001*** | 2.301 ; 2.382 |
| ses (z) | 5.376 | 0.021 | 259.66 | <0.001*** | 5.335 ; 5.416 |
| study_hours (z) | 0.310 | 0.073 | 4.24 | <0.001*** | 0.167 ; 0.453 |
| gender: male | 0.467 | 0.041 | 11.28 | <0.001*** | 0.386 ; 0.548 |
| facility (z) | 0.385 | 0.108 | 3.57 | <0.001*** | 0.174 ; 0.595 |
| teacher_exp (z) | 0.457 | 0.112 | 4.08 | <0.001*** | 0.237 ; 0.676 |
| Component | Value |
|---|---|
| τ₀₀ (intercept) | 1.876 |
| τ₁₁ (slope) | 0.147 |
| ρ | 0.96 |
| σ² | 0.365 (M3: 0.507) |
Study-hours effect by school
BLUPs: intercept û₀ vs slope û₁
Model correlation ρ = 0.96: schools with higher baseline scores tend to gain more from study hours, hinting at unmeasured school factors.
Effect of ses by school (OLS, ± 1.96 SE)
Slopes are roughly parallel across schools, supporting a random intercept only for this variable.
Effect of prior_score by school (OLS, ± 1.96 SE)
Slopes are roughly parallel across schools, supporting a random intercept only for this variable.
Random-slope LRT
Only study_hours exceeds the critical value.
Exploratory contextual model (school means)
| Parameter | Coef. | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 77.588 | 0.246 | 315.06 | <0.001*** | 77.105 ; 78.070 |
| prior_score (z) | 2.345 | 0.024 | 97.41 | <0.001*** | 2.298 ; 2.393 |
| ses (z) | 5.382 | 0.024 | 222.88 | <0.001*** | 5.334 ; 5.429 |
| study_hours (z) | 0.333 | 0.024 | 13.83 | <0.001*** | 0.286 ; 0.380 |
| gender: male | 0.422 | 0.048 | 8.73 | <0.001*** | 0.327 ; 0.516 |
| facility (z) | 0.489 | 0.271 | 1.81 | 0.071 | -0.042 ; 1.020 |
| teacher_exp (z) | 0.711 | 0.271 | 2.62 | 0.009** | 0.180 ; 1.242 |
| school-mean ses | 2.663 | 1.378 | 1.93 | 0.053 | -0.038 ; 5.363 |
| school-mean prior | -0.936 | 1.547 | -0.60 | 0.545 | -3.967 ; 2.096 |
| school-mean study | -1.920 | 1.589 | -1.21 | 0.227 | -5.035 ; 1.195 |
M3 τ₀₀ = 1.957 → contextual model 1.787. Only 30 schools: treat as a lead for future research, not a main finding.
Contextual effects, coefficient ± 1.96 SE
Solid = significant. Exploratory (30 schools).
DiagnosticsAssumption checks
Contents: model assumption checks. Result: normality and linearity hold; homoscedasticity holds only in M4.
Assumption checks
| Assumption | Test | Result | Status |
|---|---|---|---|
| Normality of residuals (M3) | Shapiro-Wilk | W=0.998, p = 0.454; skew 0.01, kurt 0.01 | ✓ |
| Normality of random effects | Shapiro-Wilk | W=0.949, p = 0.157 | ✓ (indicative, n = 30) |
| Linearity | Residual vs ses, prior | No curvature | ✓ |
| Multicollinearity | Max VIF | 1.10 | ✓ |
| Homoscedasticity M3 | Levene across schools | p < 0.001 | ✗ |
| Homoscedasticity M4 (slope) | Levene across schools | p = 0.348 | ✓ |
| Independence | Survey design | 30 randomly sampled schools | ✓ |
M3 fails homoscedasticity, consistent with a study-hours effect that differs between schools; M4 fixes it.
Q-Q plot of level-1 residuals
Residuals vs fitted
Residual histogram
Q-Q plot of school random effects
Residuals vs ses (linearity)
Residuals vs prior (linearity)
Residual SD per school: M3 vs M4 (homoscedasticity)
In M3 the residual spread varies strongly between schools; in M4 it is much more uniform.
ConclusionsTable and recommendations
Contents: M1–M4 comparison table, conclusions, recommendations and limitations.
Model summary table
| M1 Null | M2 Student | M3 Full | M4 + study slope | |
|---|---|---|---|---|
| Intercept | 77.787*** (0.381) | 77.588*** (0.281) | 77.588*** (0.258) | 77.575*** (0.252) |
| prior_score (z) | 2.345*** (0.024) | 2.345*** (0.024) | 2.341*** (0.021) | |
| ses (z) | 5.382*** (0.024) | 5.382*** (0.024) | 5.376*** (0.021) | |
| study_hours (z) | 0.333*** (0.024) | 0.332*** (0.024) | 0.310*** (0.073) | |
| gender: male | 0.421*** (0.048) | 0.422*** (0.048) | 0.467*** (0.041) | |
| facility (z) | 0.478 (0.274) | 0.385*** (0.108) | ||
| teacher_exp (z) | 0.702* (0.274) | 0.457*** (0.112) | ||
| τ₀₀ (intercept variance) | 3.165 | 2.340 | 1.957 | 1.876 |
| τ₁₁ (study slope variance) | 0.147 | |||
| ρ intercept–slope | 0.96 | |||
| σ² (student variance) | 35.408 | 0.507 | 0.507 | 0.365 |
| ICC (null) | 0.082 | |||
| PVE σ² (%) | 98.6 | 98.6 | 99.0 | |
| PVE τ₀₀ (%) | 26.1 | 38.2 | 40.7 | |
| R² marginal / conditional | 0.000 / 0.082 | 0.924 / 0.987 | 0.935 / 0.987 | – |
| AIC (ML) | 5808.4 | 2099.7 | 2096.3 | 1834.5 |
| BIC (ML) | 5822.8 | 2133.3 | 2139.5 | 1887.3 |
Coefficient (SE); * p<.05, ** p<.01, *** p<.001. N = 900 students, 30 schools.
Predicted vs observed (M3)
Observed–predicted correlation = 0.994
Conclusions by question
- Q1. ICC = 8.2%: variation is mostly between students (91.8%), but schools remain real (p < 0.001).
- Q2. Student characteristics explain 98.6% of within-school variance; SES is strongest, then prior ability.
- Q3. teacher_exp is robust (4/4 specifications); facility is positive but inconsistent (1/4). τ₀₀ falls another 16.3%.
- Q4. Between-school differences remain (62% of the initial τ₀₀; p < 0.001).
R² marginal and conditional (Nakagawa)
Fixed effects explain nearly all variation in scores.
Intervention recommendations
- Student level (priority): SES and prior ability, e.g. remedial tutoring and socioeconomic support.
- School level: improve teacher quality/experience (robust); facilities are positive but not consistent.
- Study hours: the effect depends on the school context; tailor programmes per school.
- Combined approach: between-school variance remains; investigate other school factors.
Limitations
- Observational data: associations, not causation.
- Only 30 schools: limited power at level 2, and effects are sensitive to particular schools (see leave-one-school-out).
- Normality and linearity hold; homoscedasticity across schools holds only after adding the random study_hours slope (M4).
- M4 inference relies on the intercept–slope correlation (ρ = 0.96) estimated from 30 schools.
SimulatorInteractive prediction
Contents: predicted score for a profile you choose (fixed effects of M3).
Student and school profile
Predicted score (fixed effects of M3)
Bars = contribution of each variable relative to an average student in an average school. The school random effect is set to 0.