Experimental Design Reference
Design Taxonomy
Power Analysis
What It Answers
- Given α and β, how many subjects do I need to detect a given effect?
- Given α, N, and design, what effect size can I detect?
- Given N and expected effect, what power do I have?
Key Parameters
- α (Type I error rate): usually 0.05 (two-sided) or 0.025 (one-sided)
- β (Type II error rate): usually 0.20 (power = 0.80)
- Effect size: standardized measure of the expected effect (Cohen's d, f, w, OR, etc.)
- Sample size (N): total number of units
- Design features: number of groups, number of measurements, number of covariates, ICC (clustered designs)
Power by Design Type
| Design |
Test Statistic |
Software |
Key Inputs |
| Two-group comparison (continuous, unpaired) |
Two-sample t-test |
tt_ind_solve_power() power |
d, α, power → n_per_group |
| Two-group comparison (continuous, paired) |
Paired t-test |
tt_solve_power() power |
d, α, power → n_pairs |
| Two proportions |
z-test, chi-square |
zt_ind_solve_power() or power.prop.test() |
p₁, p₂, α → n_per_group |
| One-way ANOVA (k groups) |
F-test |
power.anova() or pwr.anova.test() |
f, α, k → n_per_group |
| Multiple regression (p predictors) |
F-test for R² |
FTestRegPower() or pwr.f2.test() |
f², p, α → N |
| Logistic regression |
Wald test |
power.logistic() or vary() approaches |
OR, p_base, α → N |
| Survival (log-rank) |
Log-rank test |
power.survival.test() or power.zt.survival() |
hazard ratio, median, α → events |
| Cluster RCT (m clusters, n/cluster) |
Mixed model |
power.sim.normal() or clusterPower |
ICC, cluster size, m → power |
| ANOVA interaction |
F-test |
Manual or simulation |
f, α, design → N |
Sample Size Heuristics (Use Power Analysis Instead When Possible)
| Scenario |
Rough Rule of Thumb |
| Detect large effect (d = 0.8) |
~26 per group (t-test, α=0.05, 80% power) |
| Detect medium effect (d = 0.5) |
~64 per group |
| Detect small effect (d = 0.2) |
~394 per group |
| A/B test (10% relative increase from 10% base) |
~15,000 per arm |
| A/B test (10% relative increase from 50% base) |
~3,100 per arm |
| Cluster RCT (ICC = 0.05, 20 per cluster) |
Multiply individual-sample N by ~2.7 |
| Interaction in factorial design |
4× the sample for main effect |
Power Analysis Protocol
A/B Testing Framework
Standard Protocol
- Define the metric. Primary metric must be one, pre-specified, measurable, and tied to a business/investigator decision.
- Determine minimum detectable effect (MDE). What's the smallest effect worth acting on?
- Compute sample size. Account for multiple metrics with Bonferroni correction on α.
- Randomize properly. At the unit of analysis level. Check for sample ratio mismatch (SRM).
- Pre-register. Analysis plan including exclusion criteria, stopping rule, and primary analysis method.
- Run for pre-computed duration. Don't peek (or use sequential testing).
- Analyze. Intention-to-treat primary analysis, per-protocol sensitivity. Report effect size with CI.
- Check assumptions. Balance checks, novelty effects, network interference (SUE/stable unit treatment value assumption violation).
Common A/B Testing Mistakes
| Mistake |
Why It's Wrong |
Fix |
| Peeking at results |
Inflation of Type I error rate |
Sequential testing (always valid confidence intervals) |
| Stopping early when significant |
Same as above |
Pre-specify duration, or use sequential design |
| Multiple metrics without correction |
Inflated false positive rate |
Pre-specify primary, use Bonferroni/Holm on secondaries |
| Sample ratio mismatch (SRM) |
Indicates randomization failure |
Check χ² test on group assignment ratio |
| Novelty effect |
Early effect decays as users adapt |
Run long enough (2+ full business cycles) |
| Network interference |
Treatment spills to control (social networks, marketplace) |
Cluster randomization, design experiments at higher level |
| Segment hunting |
Finding significance in subgroups |
Pre-specify subgroups or correct for multiple comparisons |
Minimum Detectable Effect by Sample Size (Continuous, 80% power, α=0.05)
| N per arm |
MDE (Cohen's d) |
MDE (proportion, base=50%) |
MDE (proportion, base=10%) |
| 100 |
0.40 |
±14% pp |
±12% pp |
| 500 |
0.18 |
±6.3% pp |
±5.4% pp |
| 1,000 |
0.13 |
±4.4% pp |
±3.8% pp |
| 5,000 |
0.06 |
±2.0% pp |
±1.7% pp |
| 10,000 |
0.04 |
±1.4% pp |
±1.2% pp |
| 50,000 |
0.02 |
±0.6% pp |
±0.5% pp |
Blocking & Covariate Adjustment
When to Block
- You have a pre-treatment variable known to affect the outcome
- You have a limited number of experimental units and want to reduce error variance
- You can group units into homogeneous blocks
When to Use Covariate Adjustment (ANCOVA)
- Continuous pre-treatment variable correlated with outcome
- Increases statistical power beyond blocking alone
- Valid even in randomized experiments (does not introduce bias if pre-specified)
When NOT to Adjust
- Post-treatment variables (they're outcomes, not covariates — introduces selection bias)
- Variables affected by treatment (collider bias)
- Multiple covariates without pre-specification (researcher degrees of freedom)
Factorial Design Quick Reference
| Factors |
Full Factorial Runs |
½ Fraction Runs |
Resolution |
| 2 |
4 |
— |
Full |
| 3 |
8 |
4 |
III (½) |
| 4 |
16 |
8 |
IV (½) |
| 5 |
32 |
16 |
V (½) |
| 6 |
64 |
32 |
VI (½) |
| 7 |
128 |
64 |
VII (½) |
Resolution guide:
- Resolution III: Main effects may be confounded with two-way interactions. Screening only.
- Resolution IV: Main effects clear of two-way interactions; two-way interactions may be confounded with each other.
- Resolution V: Main effects and two-way interactions are clear. Three-way interactions may be confounded.