VARCOMP (Variance-Components Analysis)
v1.0.1
Engineering context — in a hierarchical design, it decomposes how much of the total variance originates from which level (site, group, subgroup, error). Equivalent to SAS PROC VARCOMP, with a REML/ML cascade in MerQur.
REML + ML fallbackICC + heritabilityσ²fabrika ≈ 18.0
🎯 What is it for?
VARCOMP answers the question of which level contributes how much variance. Is the variability in the distribution of a single urun_dayanim_MPa measurement entirely random, or does it stem from systematic differences between fabrika and uretim_hatti? With VARCOMP, σ²fabrika, σ²uretim_hatti, σ²parti and σ²residual are estimated separately; the percentage share of each is reported.
📌 When is it used?
- When there is a multilevel sampling design (nested) in the Engineering field
- For sample-size calculation when designing a data-collection plan in which you will take the same measurement on different uretim_hatti’s under different fabrika’s
- To compute heritability / generalizability (σ² ratios)
- Before even building a fixed-effect model — where does the variance primarily lie?
⚙ Assumptions
- Continuous DV (urun_dayanim_MPa).
- Nested structure: uretim_hatti within fabrika, parti within uretim_hatti (no cross-level confounding).
- Random effects ~ Normal (homoskedastic, mean 0).
- Sufficient units at each level: ≥4-6 fabrika, each with ≥2 uretim_hatti, is recommended.
📊 How to Run It in MerQur?
Panel assignments (form fields in the program):
- Columns:
{'dv': 'deger', 'factors': [('ust_birim', False), ('alt_birim', True)]} - Parameters:
{'estimator': 'REML'}
📊 Sample Dataset — Engineering
ℹ 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 Engineering:
Muhendislik/100_varcomp_3seviye_h2.xlsx
🎬 Scenario
We decompose measurement variability into nested levels (upper/lower unit). For
hierarchical variability, variance components is appropriate.
⚙️ Variable Selection
- Dependent variable: value
- Factor (categorical): upper_unit
- Factor (categorical): lower_unit (nested)
Data Preview (First 5 Rows)
| upper_unit | lower_unit | measurement_id | value |
|---|---|---|---|
| L_A | L_A_S01 | L_A_S01_M01 | 51.41 |
| L_A | L_A_S01 | L_A_S01_M02 | 52.17 |
| L_A | L_A_S01 | L_A_S01_M03 | 40.6 |
| L_A | L_A_S01 | L_A_S01_M04 | 43.19 |
| L_A | L_A_S01 | L_A_S01_M05 | 48.91 |
n = 100 · Columns: upper_unit, lower_unit, measurement_id, value
📈 MerQur Output
─────────────────────────────────────────────
Random factors: upper_unit + lower_unit (nested within upper) % contribution of each component + residual
💬 Interpretation
We decomposed a measurement’s variability into nested levels — upper unit and lower unit within upper: the percent
contribution of each level and the residual were reported. Variance components analysis answers “how much of the
variability is between upper units, how much between lower units, how much within unit?”. In the field it is used
in hierarchical structures (region>plot>replicate) to see where uncertainty concentrates and in sampling design; it
underlies ratio estimates such as heritability (h2).
⚠ Common Mistakes
- Forgetting the nested checkbox — the uretim_hatti column is clustered under fabrika (e.g. URETIM_HATTI_05_03 exists only in FABRIKA_05). If the checkbox is not checked, crossed is assumed → the variance is shared incorrectly.
- A single level at the second level — if there is a single uretim_hatti under a fabrika, VARCOMP cannot estimate that level (σ²=uretim_hatti≈0 ‘singular fit’ warning).
- Continuous DV assumption — for Bernoulli/count data, a GLMM or a categorical-VARCOMP alternative is needed instead of VARCOMP (outside MerQur’s scope).
📚 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
📝 Ü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.