Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

Statistical Power & Sample Size

Plans studies by computing required sample size, minimum detectable effect, and power curves via closed-form formulas or Monte Carlo simulation.

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

What it does

  • Runs a priori power analyses to answer "how many subjects/samples/replicates do I need?"
  • Handles standard tests (independent/paired t-tests, one-way ANOVA, one and two proportions, correlation, chi-square, regression R² increment) through one wrapper in scripts/power.py: sample_size, power, mde, power_curve.
  • For designs with no formula — logistic/Poisson regression, mixed models, cluster-randomized trials, survival, mediation, interactions — it uses scripts/simulate_power.py for Monte Carlo power with a reported simulation CI.
  • Enforces good practice: defensible effect sizes (SESOI > shrunk pilot > Cohen conventions), sensitivity analyses instead of a single n, dropout inflation, design effect 1 + (m−1)·ICC for clustering, and multiplicity-corrected alpha. Explicitly warns against post-hoc "observed" power.
  • Provides a ready-to-adapt reporting paragraph for grants, IRB protocols, and pre-registrations.

Who it's for

  • Researchers and grad students designing studies, theses, or clinical protocols.
  • Anyone who must justify a sample size to an IRB, ethics board, or funder.
  • Data analysts sizing experiments and A/B tests, or computing MDE for a fixed budget.
  • Reviewers/statisticians who want sensitivity analysis instead of circular observed power.

Example uses

  1. "How many per group to detect Cohen's d = 0.5 at 80% power, two-sided α = .05?" → n per group plus enrollment inflated for 20% attrition.
  2. "I can only recruit 30 per arm" → minimum detectable effect at that n, plus a power-curve figure for the proposal.
  3. "Cluster-randomized trial across 20 clinics with ICC = 0.05" → simulation search for the number of clusters and cluster size that reach target power.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/HEAD/skills/statistical-power/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

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. Open a terminal and go to a working directory.
  2. Clone the repository: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  3. Make sure the skills folder exists: mkdir -p ~/.claude/skills
  4. Copy just this skill: cp -r scientific-agent-skills/skills/statistical-power ~/.claude/skills/
  5. Verify Python 3.10 or newer: python3 --version
  6. Install dependencies: uv pip install "statsmodels>=0.14.6" "scipy>=1.11" "pingouin>=0.6" "numpy>=1.26" matplotlib pandas (add uv pip install lifelines for survival simulations).
  7. Restart Claude Code and ask something like "how many participants per group do I need for d = 0.5 at 80% power?" — the skill triggers automatically.