Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

Statistical Power & Sample Size

Plan studies with defensible sample sizes, minimum detectable effects, and power curves using both closed-form formulas and Monte Carlo simulation.

Data & AnalyticsIntermediate33,0303,248AI score 9/10Last updated: Aug 9, 2026

What it does

  • A priori power analysis: give an effect size, α, and target power (typically 0.80/0.90) and get the required n per group and total.
  • Closed-form solvers: independent/paired t-tests, one-way ANOVA, one/two proportions, correlation, chi-square (effect size w), and regression R² increments, all through one interface in scripts/power.py (sample_size, power, mde, power_curve).
  • Simulation-based power: for designs with no formula — logistic/Poisson regression, mixed-effects models, cluster-randomized trials with an ICC, survival analysis, mediation, interactions — via simulate → fit the planned model → repeat (≥1,000 reps) with a reported Monte Carlo CI.
  • Real-world adjustments: multiplicity (α/m or FDR by simulation), attrition (n_enroll = n/(1−dropout)), clustering design effect (DEFF = 1+(m−1)·ICC), and unequal allocation ratios.
  • Effect-size guidance and reporting: prefers SESOI over shrunken pilot estimates over Cohen conventions, provides d/f/r/η²/OR/h/w conversions, insists on sensitivity analysis rather than a single number, and explicitly warns against circular post-hoc "observed" power.

Who it's for

  • Graduate students and researchers who must justify a sample size in a thesis or paper
  • Anyone writing an IRB protocol, grant application, or pre-registration
  • Clinical and epidemiological researchers needing enrollment numbers that account for dropout and clustering
  • Data analysts sizing A/B tests or computing MDE for a fixed traffic budget

Examples

  1. "How many per group to detect d = 0.5 at 80% power, α = 0.05?" → returns n per group and total, inflates for 20% attrition, and drafts the reporting paragraph.
  2. "I can only recruit 30 per group — what can I detect?" → computes the MDE at that n and generates a power-vs-effect-size curve figure for the grant.
  3. "20 clinics randomized, 30 patients each, ICC = 0.05 — what's my power?" → writes a cluster-simulation script, runs 5,000 replicates, and reports power with a Monte Carlo 95% CI.

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/statistical-power folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/statistical-power/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/statistical-power ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Check prerequisites: run python3 --version and confirm Python 3.10 or newer; have Claude Code installed.
  2. Create the skills folder: mkdir -p ~/.claude/skills
  3. Clone the repository: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  4. Copy the skill: cp -r scientific-agent-skills/skills/statistical-power ~/.claude/skills/
  5. Install Python packages: uv pip install "statsmodels>=0.14.6" "scipy>=1.11" "pingouin>=0.6" "numpy>=1.26" matplotlib pandas, plus uv pip install lifelines if you need survival simulations. Use pip install if you don't have uv.
  6. Verify: restart Claude Code and ask something like "run an a priori power analysis for 80% power" — the skill should trigger automatically.
  7. Troubleshooting: if you hit a _lazywhere import error, upgrade to statsmodels >= 0.14.6 with scipy >= 1.11.