Nested LMM (Hiyerarşik Karma Model)
v1.0.1
Agriculture, Forestry and Fisheries context — fixed effect (treatment) + nested random effects. boy_artisi_m ~ tedavi + (1|saha/populasyon/aile). 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 Agriculture, Forestry and Aquaculture, if different treatments are applied within the same families, a classical t-test/ANOVA ignores the clustering → type-I error. A 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: population within site, family within population.
- Random effects ~ Normal(0, σ²).
- ≥1 observation in each treatment-family combination.
📊 How to Run It in MerQur
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
🧪 Example Data — Agriculture, Forestry and Fisheries
📂 samples/Ileri_Duzey_v102/ziraat-orman-su-urunleri/108_nested_lmm.xlsx · n = 216 · Treatment: Control/Treatment-A/Treatment-B · Hierarchy: site/population/family
⬇ Download the example data set (.xlsx)
| saha | populasyon | aile | tedavi | boy_artisi_m |
|---|---|---|---|---|
| SAHA_01 | POPULASYON_01_01 | AILE_01_01_01 | Kontrol | 3.489 |
| SAHA_01 | POPULASYON_01_01 | AILE_01_01_01 | Tedavi-A | 7.926 |
| SAHA_01 | POPULASYON_01_01 | AILE_01_01_01 | Tedavi-B | 10.586 |
| SAHA_01 | POPULASYON_01_01 | AILE_01_01_02 | Kontrol | 3.285 |
| SAHA_01 | POPULASYON_01_01 | AILE_01_01_02 | Tedavi-A | 7.427 |
| … | … | … | … | … |
📊 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 σ² saha 0.20 populasyon 0.09 aile 0.05 Residual 0.06
📄 APA 7 Yorumu
⚠ Common Mistakes
- Defining “crossed” instead of “nested” — the population IDs should not recur across each site.
- Optimizer crashing (lbfgs llf=inf) — MerQur resolves this with a bfgs/cg cascade.
- Treatment × site 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.