Skills

Power Analysis

Compute statistical power, required sample size, and minimum detectable effect (MDE)...

Install

npx skills add pedrohcgs/claude-code-my-workflow --skill power-analysis -g -a claude-code -y
Category
Design
Updated
1mo ago
License
MIT
Context cost
Mediumabout 2,481 tokens
Runs scripts
No, instructions only

What it does

Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section. Handles two-arm RCTs (with clustering / ICC and unequal allocation), multiple-arm corrections, and a simulation-based power option for non-standard designs (DiD/event-study, IV, panel). Use when user says "power analysis", "power calculation", "MDE", "minimum detectable effect", "how big a sample do I need", "is my study powered", "power for an RCT", or when /preregister needs a power section for an experiment. Produces a power/MDE table, power curves, and a methods paragraph to paste into a preregistration.

/power-analysis, Power / MDE for study design

Compute the three interlocking quantities of an ex-ante design calculation, power, required N, and minimum detectable effect (MDE), and emit a power section the user can paste straight into a preregistration. Analytical for standard designs; simulation-based (reusing the /simulation-study harness pattern) for non-standard ones.

Core principle: a power calculation is a design-time commitment made before the data exist. Fix any two of {effect size, N, power} and solve for the third; never back out a "power" number from a realised estimate (that is post-hoc power, and it is uninformative, see "What this skill does NOT do").

When to use

  • Before launching an RCT / field / survey experiment, to choose N (or clusters) for a target MDE at 80, 90% power.
  • Invoked by /preregister for RCTs, the AEA RCT Registry and most IRBs require a power/MDE justification; /preregister's aea-rct style follows this skill's phases to fill that section (this skill is user-invoked only, so it is read and followed, not called).
  • During R&R, when a referee asks "was this study adequately powered to detect the effect you claim?"
  • Designing a Monte Carlo, to set R and sample sizes before handing off to /simulation-study.

Inputs

$ARGUMENTS may carry flags; missing pieces are elicited in Phase 0.

  • --mode mde|n|power, solve for MDE given N+power, N given MDE+power, or power given N+MDE. Default mde.
  • --design rct|cluster|multiarm|sim, two-arm RCT, clustered RCT (ICC), multiple arms, or simulation-based. Default inferred from the elicited design.
  • --input <path>, a spec from /interview-me (under quality_reports/specs/) to pull the RQ, outcome, and design from.

Workflow

Phase 0, Elicit the design

Gather the design parameters; ask once for anything missing rather than fabricating. Required:

Read the whole SKILL.md on GitHub

More in Design