Nested LMM (Hiyerarşik Karma Model)

Nested LMM (Hiyerarşik Karma Model)

⚡ Advanced · Mixed Models · Nested

v1.0.1

Educational Sciences context — fixed effect (treatment) + nested random effects. akademik_basari_puan ~ tedavi + (1|okul/sinif/ogrenci). Difference from VARCOMP: a fixed effect (e.g. treatment/group comparison) is added.

okul/sinif/ogrenci nestedTedavi sabit etkenREMLFixed effect estimate + p

🎯 What is it for?

When interpreting fixed effects in hierarchical data, it also accounts for the variance of the random factors. In the Educational Sciences, if the same students receive different treatments, a classical t-test/ANOVA ignores the clustering → type-I error. Nested LMM computes this correctly.

📌 When is it used?

  • Comparison of a fixed effect (treatment, intervention, condition) + hierarchical sampling
  • Multi-site clinical research, multi-center field trial
  • Adjusting site/group-level variance in RCTs

⚙ Assumptions

  1. Continuous DV, categorical fixed effect.
  2. Nested structure: sinif within okul, ogrenci within sinif.
  3. Random effects ~ Normal(0, σ²).
  4. ≥1 observation in each treatment-ogrenci combination.

📊 How to Run It in MerQur

1
Load the data.
2
Analysis → ⚡ Advanced → Nested LMM.
3

Panel assignments (form fields in the program):

  • Dependent Variable: deger
  • Replication Variable: blok
  • Upper Group: ust_grup
  • Inner (Nested) Group: alt_grup_no
  • SS Type: 1
4
Estimator: REML.
5
▶ Run. Fixed-effect β̂ + p + σ² for each random level.

🧪 Sample Data — Educational Sciences

📂 samples/Ileri_Duzey_v102/egitim-bilimleri/108_nested_lmm.xlsx · n = 216 · Treatment: Control/Treatment-A/Treatment-B · Hierarchy: okul/sinif/ogrenci

⬇ Download sample data set (.xlsx)

okul sinif ogrenci tedavi akademik_basari_puan
OKUL_01 SINIF_01_01 OGRENCI_01_01_01 Kontrol 65.858
OKUL_01 SINIF_01_01 OGRENCI_01_01_01 Tedavi-A 88.177
OKUL_01 SINIF_01_01 OGRENCI_01_01_01 Tedavi-B 80.036
OKUL_01 SINIF_01_01 OGRENCI_01_01_02 Kontrol 78.301
OKUL_01 SINIF_01_01 OGRENCI_01_01_02 Tedavi-A 79.11
… … … … …

📊 MerQur Output (summary)

Nested LMM (akademik_basari_puan ~ tedavi + (1|okul/sinif/ogrenci)) REML
==================================================
Fixed effect (tedavi) β̂ SE p
Kontrol (ref) 0.00 – –
Tedavi-A +4.0 1.20 < .001 Tedavi-B +7.0 1.20 < .001 Random components σ² okul 64.00 sinif 25.00 ogrenci 16.00 Residual 36.00

📄 APA 7 Yorumu

A nested LMM was fitted on 216 observations of nested data (school = 6) in the Educational Sciences field. Relative to the control group, Treatment-A increased akademik_basari_puan by 4.0 units and Treatment-B by 7.0 units (both p < .001). The random components are at the expected σ² magnitudes, and the ICC is at a moderate level.

⚠ Common Mistakes

  • Specifying “crossed” instead of “nested” — the class-ids should not recur within each school.
  • Optimizer stalling (lbfgs llf=inf) — MerQur resolves this with a bfgs/cg cascade.
  • Treatment × school imbalance — the fixed-effect coefficient may be biased.

📚 Cite MerQur

Örücü, Ö. K. (2026). MerQur: An Integrated Platform for Academic Data Analysis and Reporting [Computer Software] (Version 1.0.0). https://doi.org/10.53463/merqur.2026001

All citation formats →

📝 Production Note — The sample data on this page was generated synthetically (fixed SEED=42, generator: samples/Ileri_Duzey_v102/_generate_v102_datasets.py). The page content was prepared with the support of Anthropic Claude, and its academic accuracy was verified by the author.