Statistical Power Analysis Cheat Sheet

Statistical power, Type I/II errors, effect size (Cohen's d), sample size determination, and power curves for A/B testing and experimental design.

Last Updated: July 15, 2025

Error Types

H₀ TrueH₀ False
Reject H₀Type I Error (α)Correct (Power = 1−β) ✓
Fail to Reject H₀Correct ✓Type II Error (β)

Power Determinants

FactorEffect on Power
Sample Size (n) ↑Power ↑ — larger samples reduce standard error
Effect Size (d) ↑Power ↑ — bigger effects easier to detect
Significance (α) ↑Power ↑ — looser threshold, but more false positives
Variance (σ²) ↑Power ↓ — noisier data masks effects

Cohen's d (Effect Size)

d ValueInterpretationExample
0.2SmallHeight difference between 15 and 16-year-old girls
0.5MediumVisible to naked eye — height difference 14 vs 18-year-old girls
0.8LargeGrossly perceptible — height difference 13 vs 18-year-old girls

Sample Size Formulas (Two-Sample t-test)

TargetFormula
Per Groupn = 2(Z₁₋α/₂ + Z₁₋β)² / d²
80% Power, α=0.05n ≈ 16/d² (rule of thumb)
d=0.5 (medium)n ≈ 64 per group
d=0.2 (small)n ≈ 400 per group

Python: Power Analysis

from statsmodels.stats.power import TTestIndPower
Two-sample t-test power
analysis = TTestIndPower()
Create analysis object
n = analysis.solve_power(effect_size=0.5, power=0.8, alpha=0.05)
Required sample size per group
power = analysis.solve_power(effect_size=0.5, nobs1=100, alpha=0.05)
Power given sample size
Pro Tip: 80% power is the industry standard minimum. Below 80%, you risk running an experiment that cannot detect a real effect. Above 95%, you may be wasting resources on oversized samples.
Part of the Empire Builder Network