statistical-power

Featured

Sample-size and statistical power calculations for planning studies. Use whenever someone asks "how many subjects/samples/replicates do I need", wants an a priori power analysis, a minimum detectable effect (MDE), a power curve, or needs to justify a sample size for a grant, IRB protocol, or pre-registration. Covers closed-form power for t-tests, ANOVA, proportions, correlations, chi-square, and regression, plus simulation-based (Monte Carlo) power for designs with no formula — logistic/Poisson regression, mixed models, cluster-randomized trials, survival, and interactions. Use this skill even when the request only mentions an effect size, alpha, or "80% power" without saying "power analysis" explicitly. For laying out the study (randomization, blocking, factorial/DOE, crossover, sequential designs) use experimental-design; for analyzing data already collected and reporting it use statistical-analysis.

Web & Frontend 2,881 stars 365 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 98/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Statistical Power & Sample Size ## Overview Power analysis answers one of the most consequential questions in study planning: **how large a sample do you need to reliably detect an effect of a given size, and what could you detect with the sample you can afford?** An underpowered study wastes resources and produces inconclusive or irreproducible results; an overpowered one wastes participants, money, and (in clinical work) exposes more people to risk than necessary. Getting this right *before* data collection is the single highest-leverage statistical decision in a project. Four quantities are locked together for any given test: **sample size (n)**, **effect size**, **significance level (α)**, and **power (1 − β)**. Fix any three and the fourth is determined. Every calculation in this skill is some rearrangement of that relationship. This skill covers the two ways to do power analysis: - **Closed-form** formulas (fast, exact for standard tests) — see `references/closed_form_recipes.md`. - **Simulation / Monte Carlo** (works for *any* design or model you can simulate and analyze) — see `references/simulation_based_power.md`. For choosing and converting effect sizes — usually the hardest part — see `references/effect_sizes.md`. ## When to Use This Skill - Determining required sample size before collecting data (a priori power analysis) - Finding the minimum detectable effect (MDE) for a fixed, already-determined sample size - Producing power curves (power vs. n, or pow...

Details

Author
xintaofei
Repository
xintaofei/codeg
Created
6 months ago
Last Updated
today
Language
Rust
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category