vlt.stats.power.simulate_lme_data_hierarchical
SIMULATE_LME_DATA_HIERARCHICAL - (Helper) Generates data using the 'hierarchical' method.
Methodology:
This is a sophisticated non-parametric method that respects the nested
structure of a mixed-effects model. It simulates the null hypothesis by
shuffling the outcome variable *within* each random effect group. This
breaks the association between the fixed effects and the outcome, while
correctly preserving the dependencies among observations in the same group.
Process:
1. For each group (e.g., for each manufacturer 'Mfg'), it takes all the
observed Y values.
2. It shuffles these Y values *only within that group*.
3. This is repeated independently for every group.
4. The result is a simulated null dataset where the within-group data
structure is maintained, but the relationship between Y and the fixed
predictors (like 'Model_Year') is randomized.
5. Injects the `effect_size` to create the alternative hypothesis dataset.
Assumptions:
- Assumes "exchangeability" of observations *within* each group.
Pros/Cons:
+ Robust to violations of normality.
+ Theoretically sound for mixed models as it preserves the random-effects
structure. It is generally the preferred non-parametric method.
- May be less effective if some groups have very few observations to shuffle.