Nested LMM (Hierarchical Mixed Model)

Nested LMM (Hierarchical Mixed Model)

⚡ Advanced · Mixed Models · Nested

v1.0.1

Sport Sciences context — fixed effect (treatment) + nested random effects. sicrama_yuksekligi_cm ~ tedavi + (1|kulup/antrenor/sporcu). Difference from VARCOMP: a fixed effect (e.g. treatment/group comparison) is added.

kulup/antrenor/sporcu nestedTedavi sabit etkenREMLFixed effect estimate + p

🎯 What is it for?

It accounts for the variance of the random factors while interpreting fixed effects in hierarchical data. In Sport Sciences, if different treatments are applied to the same athletes, 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

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

📊 How to Run It in MerQur?

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

Panel assignments (form fields in the program):

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

📊 Sample Dataset — Sport Sciences

ℹ Note: The scenario, MerQur output and interpretation below were produced by actually running the real example dataset in MerQur. Numeric results on your own data will differ; the goal is to show how the analysis is set up and interpreted end-to-end.

🎬 Example File

This analysis is demonstrated on the following example dataset for Sport Sciences:

Spor_Bilimleri/108_nested_lmm_R_P_F.xlsx

🎬 Scenario

We model a value in a nested design (upper>lower>block). For nested hierarchies,
nested LMM is appropriate.

⚙️ Variable Selection

  • Dependent variable: value
  • Factor (categorical): lower_group_no
  • Factor (categorical): upper_group
  • Factor (categorical): block

Data Preview (First 5 Rows)

unit_id block upper_group lower_group_no value
B001 R1 P1 F01 43.23
B002 R1 P1 F01 48.59
B003 R1 P1 F01 43.18
B004 R2 P1 F01 41.92
B005 R2 P1 F01 43.46

n = 288 · Columns: unit_id, block, upper_group, lower_group_no, value

📈 MerQur Output

NESTED LMM (HIERARCHICAL MIXED MODEL) RESULT
─────────────────────────────────────────────

upper_group (P) effect: F = 27.44, p < .001 *** lower_group_no (R) effect: F = 6.11, p < .001 ***
nested variance components (block within P)

💬 Interpretation

We modeled a value in a nested design (upper group > lower group > block): both the upper level (F = 27.44, p <
.001) and the lower/replication level (F = 6.11, p < .001) make significant contributions. Nested LMM correctly
handles hierarchies where sub-units are nested within super-units (each block belongs to only one group); by
partitioning variance into levels it shows each layer’s share. In sports science it is used to correctly separate
effects in club>team>athlete hierarchies.

⚠ Common Mistakes

  • Defining “crossed” instead of “nested” — the coach IDs should not recur across each club.
  • Optimizer crashing (lbfgs llf=inf) — MerQur resolves this with a bfgs/cg cascade.
  • Treatment × club imbalance — the fixed effect coefficient may be biased.

📚 MerQur’a Atıf

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

Tüm atıf formatları →

📝 Üretim Notu — Bu sayfadaki örnek veri sentetik olarak üretilmiştir (sabit SEED=42, generator: samples/Ileri_Duzey_v102/_generate_v102_datasets.py). Sayfa içeriği Anthropic Claude desteği ile hazırlanmış, akademik doğruluk yazar tarafından kontrol edilmiştir.