Nested LMM (Hiyerarşik Karma Model)
v1.0.1
Architecture, Planning and Design context — fixed effect (treatment) + nested random effects. kullanici_memnuniyet_skoru ~ tedavi + (1|sehir/mahalle/yapi). Difference from VARCOMP: a fixed effect (e.g. treatment/group comparison) is added.
🎯 What is it for?
When interpreting fixed effects in hierarchical data, it also accounts for the variance of the random factors. In Architecture, Planning and Design, if the same structures 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
- Continuous DV, categorical fixed effect.
- Nested structure: neighborhood within city, building within neighborhood.
- Random effects ~ Normal(0, σ²).
- ≥1 observation in each treatment-building combination.
📊 How to Run It in MerQur?
Panel assignments (form fields in the program):
- Dependent variable (DV):
memnuniyet - Replication (R):
vizit - Upper-level group (P):
sehir - Lower-level group (F):
park_no - SS method:
1
🧪 Example Data — Architecture, Planning and Design
📂 samples/Ileri_Duzey_v102/mimarlik-planlama-tasarim/108_nested_lmm.xlsx · n = 216 · Treatment: Control/Treatment-A/Treatment-B · Hierarchy: sehir/mahalle/yapi
⬇ Download sample data set (.xlsx)
| sehir | mahalle | yapi | tedavi | kullanici_memnuniyet_skoru |
|---|---|---|---|---|
| SEHIR_01 | MAHALLE_01_01 | YAPI_01_01_01 | Kontrol | 47.686 |
| SEHIR_01 | MAHALLE_01_01 | YAPI_01_01_01 | Tedavi-A | 63.451 |
| SEHIR_01 | MAHALLE_01_01 | YAPI_01_01_01 | Tedavi-B | 69.705 |
| SEHIR_01 | MAHALLE_01_01 | YAPI_01_01_02 | Kontrol | 58.995 |
| SEHIR_01 | MAHALLE_01_01 | YAPI_01_01_02 | Tedavi-A | 69.537 |
| … | … | … | … | … |
📊 MerQur Output (summary)
==================================================
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 σ² sehir 36.00 mahalle 16.00 yapi 9.00 Residual 25.00
📄 APA 7 Yorumu
⚠ Common Mistakes
- Specifying “crossed” instead of “nested” — the neighborhood-ids must not repeat across each sehir.
- Optimizer stalling (lbfgs llf=inf) — MerQur resolves it with a bfgs/cg cascade.
- Treatment × sehir 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
📝 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.