mcpbeat Sign in

Grad Hlm Agent Skill

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'.

3k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
223
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/asgard-ai-platform/skills --skill grad-hlm

What comes with it

5 872 bytes besides the instruction
examples/sample_scenario.md

The instruction itself

13 sections, as written by the author

階層線性模型 (Hierarchical Linear Modeling)

Overview

Hierarchical Linear Modeling (HLM), also called multilevel modeling, accounts for the nested structure of data where lower-level units (e.g., students, employees) are clustered within higher-level units (e.g., schools, firms). By partitioning variance into within-group and between-group components and allowing intercepts and slopes to vary randomly, HLM produces unbiased estimates and correct standard errors.

When to Use

  • Data has a hierarchical or nested structure (individuals within groups)
  • Intra-class correlation (ICC) is non-trivial (rule of thumb: ICC > 0.05)
  • Research questions involve cross-level interactions (group-level moderators of individual-level effects)
  • Repeated measures or longitudinal data nested within subjects (growth models)

When NOT to Use

  • Data are not nested or clustering is negligible (ICC near zero)
  • Number of groups is very small (fewer than 20 Level-2 units)
  • Interest is purely in fixed effects with no group-level predictors
  • The nesting structure is crossed, not hierarchical (use crossed random effects instead)

Assumptions

IRON 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.

Key assumptions:

  • Level-1 residuals are normally distributed with constant variance within groups
  • Random effects (intercepts, slopes) are normally distributed across groups
  • Random effects are independent of Level-1 and Level-2 predictors (unless modeled)
  • Sufficient number of Level-2 units for stable variance component estimation

Methodology

Step 1 — Estimate the Null Model (Unconditional)

Run an intercept-only model to compute ICC = τ₀₀ / (τ₀₀ + σ²). This tells you what proportion of total variance lies between groups. If ICC is near zero, HLM may be unnecessary.

Step 2 — Add Level-1 Predictors (Random Intercept Model)

Include individual-level predictors with a random intercept. Group-mean center Level-1 predictors if the research question distinguishes within-group from between-group effects. See references/ for centering decisions and equations.

Step 3 — Add Level-2 Predictors and Cross-Level Interactions

Include group-level predictors to explain between-group variance in intercepts. Add cross-level interactions to test whether group characteristics moderate individual-level slopes. Allow slopes to vary randomly if theoretically justified.

Step 4 — Evaluate Model and Report

Compare models using deviance (-2LL), AIC, BIC. Report fixed effects with robust standard errors, variance components, and proportion of variance explained at each level.

Output Format

## 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]

Gotchas

  • Grand-mean centering and group-mean centering answer fundamentally different research questions
  • Too few Level-2 units (< 20) yields biased variance component estimates
  • Adding random slopes without theoretical justification can cause non-convergence
  • Pseudo-R² at Level 2 can be negative if adding Level-1 predictors redistributes variance
  • Ignoring Level-3 nesting (students in classrooms in schools) when it exists biases Level-2 estimates
  • Multicollinearity between Level-1 and Level-2 predictors inflates standard errors of cross-level interactions

References

  • Raudenbush, S. W., & Bryk, A. S. (2002). *Hierarchical Linear Models* (2nd ed.). Sage.
  • Hox, J. J., Moerbeek, M., & van de Schoot, R. (2018). *Multilevel Analysis* (3rd ed.). Routledge.
  • Snijders, T. A. B., & Bosker, R. J. (2012). *Multilevel Analysis* (2nd ed.). Sage.

Other skills for the same job

different authors, same section of the catalogue
Invoice Organizer
by frostant
×5

Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and sorting them into logical folders. Turns hours of manual bookkeeping into minutes of automated organization.

3k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Analyzing Financial Statements
by anthropics
vendor ×2

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

8k tokens scripts
Creating Financial Models
by anthropics
vendor ×2

This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

8k tokens scripts
Earnings Calendar
by nicepkg
×2

This skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. Use this when the user requests earnings calendar data, wants to know which companies are reporting earnings in the upcoming week, or needs a weekly earnings review. The skill focuses on mid-cap and above companies (over $2B market cap) that have significant market impact, organizing the data by date and timing in a clean markdown table format. Supports multiple environments (CLI, Desktop, Web) with flexible API key management.

17k tokens scripts
Agentic Wallet
by coinbase
vendor ×2

Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.

14k tokens
Alpha Vantage
by christophacham
×2

Access real-time and historical stock market data, forex rates, cryptocurrency prices, commodities, economic indicators, and 50+ technical indicators via the Alpha Vantage API. Use when fetching stock prices (OHLCV), company fundamentals (income statement, balance sheet, cash flow), earnings, options data, market news/sentiment, insider transactions, GDP, CPI, treasury yields, gold/silver/oil prices, Bitcoin/crypto prices, forex exchange rates, or calculating technical indicators (SMA, EMA, MACD, RSI, Bollinger Bands). Requires a free API key from alphavantage.co.

13k tokens
Braintree Automation
by christophacham
×2

Braintree Automation: manage payment processing via Stripe-compatible tools for customers, subscriptions, payment methods, and transactions

2k tokens needs MCP

How to use it

Copy the folder

Take asgard-ai-platform/grad-hlm from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.