Loading...
Loading...
Apply Hierarchical Linear Modeling (HLM) to analyze nested data structures with random intercepts and slopes, accounting for intra-class correlation and cross-level interactions. Use this skill when the user has students nested in schools, employees in firms, or repeated measures in individuals, needs to partition variance across levels, or when they ask 'how do I handle nested data', 'what is ICC', or 'do group-level factors moderate individual-level relationships'.
npx skill4agent add asgard-ai-platform/skills grad-hlmIRON LAW: Ignoring nested structure when ICC is non-trivial produces
UNDERESTIMATED standard errors — leading to inflated Type I error rates.
OLS treats clustered observations as independent, overstating precision.references/## HLM Analysis: [Study Title]
### Data Structure
| Level | Unit | N |
|-------|------|---|
| Level 1 | [individual] | xxx |
| Level 2 | [group] | xxx |
### ICC (Null Model)
- ICC = x.xx (x% of variance is between groups)
### Fixed Effects
| Predictor | Level | γ | S.E. | t | p-value |
|-----------|-------|---|------|---|---------|
| Intercept | — | x.xx | x.xx | x.xx | x.xx |
| [L1 var] | 1 | x.xx | x.xx | x.xx | x.xx |
| [L2 var] | 2 | x.xx | x.xx | x.xx | x.xx |
| [Cross-level] | 1×2 | x.xx | x.xx | x.xx | x.xx |
### Random Effects
| Component | Variance | SD | p-value |
|-----------|----------|-----|---------|
| Intercept (τ₀₀) | x.xx | x.xx | x.xx |
| Slope (τ₁₁) | x.xx | x.xx | x.xx |
| Residual (σ²) | x.xx | x.xx | — |
### Model Comparison
| Model | -2LL | AIC | Parameters | Δ deviance (p) |
|-------|------|-----|------------|---------------|
| Null | x.xx | x.xx | x | — |
| Final | x.xx | x.xx | x | x.xx (x.xx) |
### Limitations
- [Note any assumption violations]