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 & AnalyticsIntermediate★ 33,030⑂ 3,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.pyfor 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)·ICCfor 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
- "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.
- "I can only recruit 30 per arm" → minimum detectable effect at that n, plus a power-curve figure for the proposal.
- "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)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the 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.
- Open a terminal and go to a working directory.
- Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Make sure the skills folder exists:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/statistical-power ~/.claude/skills/ - Verify Python 3.10 or newer:
python3 --version - Install dependencies:
uv pip install "statsmodels>=0.14.6" "scipy>=1.11" "pingouin>=0.6" "numpy>=1.26" matplotlib pandas(adduv pip install lifelinesfor survival simulations). - 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.
View source on GitHub ↗License: MIT