Skill Tracer
Skills › Marketing Skills › ab-testing › sample-size-guide.md

sample-size-guide.md

278 lines · skills/ab-testing/references/sample-size-guide.md at 88c79f6

Open on GitHub
1# Sample Size Guide
2
3Reference for calculating sample sizes and test duration.
4

Sample Size Guide

Reference for calculating sample sizes and test duration.

Raw lines 1 to 4
5## Contents
6- Sample Size Fundamentals (required inputs, what these mean)
7- Sample Size Quick Reference Tables
8- Duration Calculator (formula, examples, minimum duration rules, maximum duration guidelines)
9- Online Calculators
10- Adjusting for Multiple Variants
11- Common Sample Size Mistakes
12- When Sample Size Requirements Are Too High
13- Sequential Testing
14- Quick Decision Framework

Contents

  • Sample Size Fundamentals (required inputs, what these mean)
  • Sample Size Quick Reference Tables
  • Duration Calculator (formula, examples, minimum duration rules, maximum duration guidelines)
  • Online Calculators
  • Adjusting for Multiple Variants
  • Common Sample Size Mistakes
  • When Sample Size Requirements Are Too High
  • Sequential Testing
  • Quick Decision Framework
Raw lines 5 to 15
16## Sample Size Fundamentals

Sample Size Fundamentals

Raw lines 16 to 17
18### Required Inputs
201. **Baseline conversion rate**: Your current rate
212. **Minimum detectable effect (MDE)**: Smallest change worth detecting
223. **Statistical significance level**: Usually α = 0.05 (5%)
234. **Statistical power**: Usually 80% (β = 0.20)

Required Inputs

  1. Baseline conversion rate: Your current rate
  2. Minimum detectable effect (MDE): Smallest change worth detecting
  3. Statistical significance level: Usually α = 0.05 (5%)
  4. Statistical power: Usually 80% (β = 0.20)
Raw lines 18 to 24
25### What These Mean
27**Baseline conversion rate**: If your page converts at 5%, that's your baseline.
29**MDE (Minimum Detectable Effect)**: The smallest improvement you care about detecting. Set this based on:
30- Business impact (is a 5% lift meaningful?)
31- Implementation cost (worth the effort?)
32- Realistic expectations (what have past tests shown?)
34**Significance level (α = 0.05)**: For the planned test and its assumptions, limits the long-run probability of rejecting a true null hypothesis to 5%. It is not the probability that an observed difference is “due to chance.” Repeated unadjusted looks or multiple comparisons do not retain that error rate. See the [ASA's interpretation guidance](https://www.amstat.org/asa/files/pdfs/p-valuestatement.pdf).
36**Statistical power (80%)**: Means if there's a real effect of size MDE, you have 80% chance of detecting it.
38---

What These Mean

Baseline conversion rate: If your page converts at 5%, that's your baseline.

MDE (Minimum Detectable Effect): The smallest improvement you care about detecting. Set this based on:

  • Business impact (is a 5% lift meaningful?)
  • Implementation cost (worth the effort?)
  • Realistic expectations (what have past tests shown?)

Significance level (α = 0.05): For the planned test and its assumptions, limits the long-run probability of rejecting a true null hypothesis to 5%. It is not the probability that an observed difference is “due to chance.” Repeated unadjusted looks or multiple comparisons do not retain that error rate. See the ASA's interpretation guidance.

Statistical power (80%): Means if there's a real effect of size MDE, you have 80% chance of detecting it.


Raw lines 25 to 39
40## Sample Size Quick Reference Tables
42All tables assume α = 0.05 (two-sided) and 80% power, two-proportion test, rounded to two significant figures. Use a calculator for your exact numbers.

Sample Size Quick Reference Tables

All tables assume α = 0.05 (two-sided) and 80% power, two-proportion test, rounded to two significant figures. Use a calculator for your exact numbers.

Raw lines 40 to 43
44### Conversion Rate: 1%
46| Lift to Detect | Sample per Variant | Total Sample |
47|----------------|-------------------|--------------|
48| 5% (1% → 1.05%) | 640,000 | 1,280,000 |
49| 10% (1% → 1.1%) | 160,000 | 320,000 |
50| 20% (1% → 1.2%) | 43,000 | 86,000 |
51| 50% (1% → 1.5%) | 7,700 | 15,400 |
52| 100% (1% → 2%) | 2,300 | 4,600 |

Conversion Rate: 1%

Lift to DetectSample per VariantTotal Sample
5% (1% → 1.05%)640,0001,280,000
10% (1% → 1.1%)160,000320,000
20% (1% → 1.2%)43,00086,000
50% (1% → 1.5%)7,70015,400
100% (1% → 2%)2,3004,600
Raw lines 44 to 53
54### Conversion Rate: 3%
56| Lift to Detect | Sample per Variant | Total Sample |
57|----------------|-------------------|--------------|
58| 5% (3% → 3.15%) | 210,000 | 420,000 |
59| 10% (3% → 3.3%) | 53,000 | 106,000 |
60| 20% (3% → 3.6%) | 14,000 | 28,000 |
61| 50% (3% → 4.5%) | 2,500 | 5,000 |
62| 100% (3% → 6%) | 750 | 1,500 |

Conversion Rate: 3%

Lift to DetectSample per VariantTotal Sample
5% (3% → 3.15%)210,000420,000
10% (3% → 3.3%)53,000106,000
20% (3% → 3.6%)14,00028,000
50% (3% → 4.5%)2,5005,000
100% (3% → 6%)7501,500
Raw lines 54 to 63
64### Conversion Rate: 5%
66| Lift to Detect | Sample per Variant | Total Sample |
67|----------------|-------------------|--------------|
68| 5% (5% → 5.25%) | 120,000 | 240,000 |
69| 10% (5% → 5.5%) | 31,000 | 62,000 |
70| 20% (5% → 6%) | 8,200 | 16,400 |
71| 50% (5% → 7.5%) | 1,500 | 3,000 |
72| 100% (5% → 10%) | 430 | 860 |

Conversion Rate: 5%

Lift to DetectSample per VariantTotal Sample
5% (5% → 5.25%)120,000240,000
10% (5% → 5.5%)31,00062,000
20% (5% → 6%)8,20016,400
50% (5% → 7.5%)1,5003,000
100% (5% → 10%)430860
Raw lines 64 to 73
74### Conversion Rate: 10%
76| Lift to Detect | Sample per Variant | Total Sample |
77|----------------|-------------------|--------------|
78| 5% (10% → 10.5%) | 58,000 | 116,000 |
79| 10% (10% → 11%) | 15,000 | 30,000 |
80| 20% (10% → 12%) | 3,800 | 7,600 |
81| 50% (10% → 15%) | 690 | 1,380 |
82| 100% (10% → 20%) | 200 | 400 |

Conversion Rate: 10%

Lift to DetectSample per VariantTotal Sample
5% (10% → 10.5%)58,000116,000
10% (10% → 11%)15,00030,000
20% (10% → 12%)3,8007,600
50% (10% → 15%)6901,380
100% (10% → 20%)200400
Raw lines 74 to 83
84### Conversion Rate: 20%
86| Lift to Detect | Sample per Variant | Total Sample |
87|----------------|-------------------|--------------|
88| 5% (20% → 21%) | 26,000 | 52,000 |
89| 10% (20% → 22%) | 6,500 | 13,000 |
90| 20% (20% → 24%) | 1,700 | 3,400 |
91| 50% (20% → 30%) | 290 | 580 |
92| 100% (20% → 40%) | 81 | 162 |
94---

Conversion Rate: 20%

Lift to DetectSample per VariantTotal Sample
5% (20% → 21%)26,00052,000
10% (20% → 22%)6,50013,000
20% (20% → 24%)1,7003,400
50% (20% → 30%)290580
100% (20% → 40%)81162

Raw lines 84 to 95
96## Duration Calculator

Duration Calculator

Raw lines 96 to 97
98### Formula
100```
101Duration (days) = (Sample per variant × Number of variants) / (Daily traffic × % exposed)
103For unequal allocation, calculate each arm separately:
104Days per arm = Required sample for that arm / (Daily eligible traffic × Exposure fraction × Arm allocation fraction)
105Total collection time = longest arm duration
106```
108Use fractions for exposure and allocation (50% = 0.5). Count eligible randomized units consistently with the sample-size calculation; repeat pageviews are not additional participants. The balanced formula assumes equal sample requirements and equal allocation.

Formula

Duration (days) = (Sample per variant × Number of variants) / (Daily traffic × % exposed)

For unequal allocation, calculate each arm separately:
Days per arm = Required sample for that arm / (Daily eligible traffic × Exposure fraction × Arm allocation fraction)
Total collection time = longest arm duration

Use fractions for exposure and allocation (50% = 0.5). Count eligible randomized units consistently with the sample-size calculation; repeat pageviews are not additional participants. The balanced formula assumes equal sample requirements and equal allocation.

Raw lines 98 to 109
110### Examples
112**Scenario 1: High-traffic page**
113- Need: 10,000 per variant (2 variants = 20,000 total)
114- Daily traffic: 5,000 visitors
115- 100% exposed to test
116- Duration: 20,000 / 5,000 = **4 days**
118**Scenario 2: Medium-traffic page**
119- Need: 30,000 per variant (60,000 total)
120- Daily traffic: 2,000 visitors
121- 100% exposed
122- Duration: 60,000 / 2,000 = **30 days**
124**Scenario 3: Low-traffic with partial exposure**
125- Need: 15,000 per variant (30,000 total)
126- Daily traffic: 500 visitors
127- 50% exposed to test
128- Effective daily: 250
129- Duration: 30,000 / 250 = **120 days** (too long!)

Examples

Scenario 1: High-traffic page

  • Need: 10,000 per variant (2 variants = 20,000 total)
  • Daily traffic: 5,000 visitors
  • 100% exposed to test
  • Duration: 20,000 / 5,000 = 4 days

Scenario 2: Medium-traffic page

  • Need: 30,000 per variant (60,000 total)
  • Daily traffic: 2,000 visitors
  • 100% exposed
  • Duration: 60,000 / 2,000 = 30 days

Scenario 3: Low-traffic with partial exposure

  • Need: 15,000 per variant (30,000 total)
  • Daily traffic: 500 visitors
  • 50% exposed to test
  • Effective daily: 250
  • Duration: 30,000 / 250 = 120 days (too long!)
Raw lines 110 to 130
131### Minimum Duration Rules
133Even with sufficient sample size, run tests for at least:
134- **1 full week**: To capture day-of-week variation
135- **2 business cycles**: If B2B (weekday vs. weekend patterns)
136- **Through paydays**: If e-commerce (beginning/end of month)

Minimum Duration Rules

Even with sufficient sample size, run tests for at least:

  • 1 full week: To capture day-of-week variation
  • 2 business cycles: If B2B (weekday vs. weekend patterns)
  • Through paydays: If e-commerce (beginning/end of month)
Raw lines 131 to 137
138### Maximum Duration Guidelines
140Avoid running tests longer than 4-8 weeks:
141- Novelty effects wear off
142- External factors intervene
143- Opportunity cost of other tests
145---

Maximum Duration Guidelines

Avoid running tests longer than 4-8 weeks:

  • Novelty effects wear off
  • External factors intervene
  • Opportunity cost of other tests

Raw lines 138 to 146
147## Online Calculators

Online Calculators

Raw lines 147 to 148
149### Recommended Tools
151**Evan Miller's Calculator**
152https://www.evanmiller.org/ab-testing/sample-size.html
153- Simple interface
154- Bookmark-worthy
156**Optimizely's Calculator**
157https://www.optimizely.com/sample-size-calculator/
158- Business-friendly language
159- Duration estimates
161**AB Test Guide Calculator**
162https://www.abtestguide.com/calc/
163- Includes Bayesian option
164- Multiple test types
166**VWO Duration Calculator**
167https://vwo.com/tools/ab-test-duration-calculator/
168- Duration-focused
169- Good for planning
171---

Recommended Tools

Evan Miller's Calculator https://www.evanmiller.org/ab-testing/sample-size.html

  • Simple interface
  • Bookmark-worthy

Optimizely's Calculator https://www.optimizely.com/sample-size-calculator/

  • Business-friendly language
  • Duration estimates

AB Test Guide Calculator https://www.abtestguide.com/calc/

  • Includes Bayesian option
  • Multiple test types

VWO Duration Calculator https://vwo.com/tools/ab-test-duration-calculator/

  • Duration-focused
  • Good for planning

Raw lines 149 to 172
173## Adjusting for Multiple Variants
175With more than 2 variants (A/B/n tests), you need more sample:
177| Variants | Multiplier |
178|----------|------------|
179| 2 (A/B) | 1x |
180| 3 (A/B/C) | ~1.5x |
181| 4 (A/B/C/D) | ~2x |
182| 5+ | Consider reducing variants |
184**Why?** More comparisons increase chance of false positives. You're comparing:
185- A vs B
186- A vs C
187- B vs C (sometimes)
189Apply Bonferroni correction or use tools that handle this automatically.
191---

Adjusting for Multiple Variants

With more than 2 variants (A/B/n tests), you need more sample:

VariantsMultiplier
2 (A/B)1x
3 (A/B/C)~1.5x
4 (A/B/C/D)~2x
5+Consider reducing variants

Why? More comparisons increase chance of false positives. You're comparing:

  • A vs B
  • A vs C
  • B vs C (sometimes)

Apply Bonferroni correction or use tools that handle this automatically.


Raw lines 173 to 192
193## Common Sample Size Mistakes

Common Sample Size Mistakes

Raw lines 193 to 194
195### 1. Underpowered tests
196**Problem**: Not enough sample to detect realistic effects
197**Fix**: Be realistic about MDE, get more traffic, or don't test

1. Underpowered tests

Problem: Not enough sample to detect realistic effects Fix: Be realistic about MDE, get more traffic, or don't test

Raw lines 195 to 198
199### 2. Overpowered tests
200**Problem**: Waiting for sample size when you already have significance
201**Fix**: This is actually fine—you committed to sample size, honor it

2. Overpowered tests

Problem: Waiting for sample size when you already have significance Fix: This is actually fine—you committed to sample size, honor it

Raw lines 199 to 202
203### 3. Wrong baseline rate
204**Problem**: Using wrong conversion rate for calculation
205**Fix**: Use the specific metric and page, not site-wide averages

3. Wrong baseline rate

Problem: Using wrong conversion rate for calculation Fix: Use the specific metric and page, not site-wide averages

Raw lines 203 to 206
207### 4. Ignoring segments
208**Problem**: Calculating for full traffic, then analyzing segments
209**Fix**: If you plan segment analysis, calculate sample for smallest segment

4. Ignoring segments

Problem: Calculating for full traffic, then analyzing segments Fix: If you plan segment analysis, calculate sample for smallest segment

Raw lines 207 to 210
211### 5. Testing too many things
212**Problem**: Dividing traffic too many ways
213**Fix**: Prioritize ruthlessly, run fewer concurrent tests
215---

5. Testing too many things

Problem: Dividing traffic too many ways Fix: Prioritize ruthlessly, run fewer concurrent tests


Raw lines 211 to 216
217## When Sample Size Requirements Are Too High
219Options when you can't get enough traffic:
2211. **Increase MDE**: Accept only detecting larger effects (20%+ lift)
2222. **Lower confidence**: Use 90% instead of 95% (risky, document it)
2233. **Reduce variants**: Test only the most promising variant
2244. **Combine traffic**: Test across multiple similar pages
2255. **Test upstream**: Test earlier in funnel where traffic is higher
2266. **Don't test**: Make decision based on qualitative data instead
2277. **Longer test**: Accept longer duration (weeks/months)
229---

When Sample Size Requirements Are Too High

Options when you can't get enough traffic:

  1. Increase MDE: Accept only detecting larger effects (20%+ lift)
  2. Lower confidence: Use 90% instead of 95% (risky, document it)
  3. Reduce variants: Test only the most promising variant
  4. Combine traffic: Test across multiple similar pages
  5. Test upstream: Test earlier in funnel where traffic is higher
  6. Don't test: Make decision based on qualitative data instead
  7. Longer test: Accept longer duration (weeks/months)

Raw lines 217 to 230
231## Sequential Testing
233If you must check results before reaching sample size:

Sequential Testing

If you must check results before reaching sample size:

Raw lines 231 to 234
235### What is it?
236Statistical method that adjusts for multiple looks at data.

What is it?

Statistical method that adjusts for multiple looks at data.

Raw lines 235 to 237
238### When to use
239- High-risk changes
240- Need to stop bad variants early
241- Time-sensitive decisions

When to use

  • High-risk changes
  • Need to stop bad variants early
  • Time-sensitive decisions
Raw lines 238 to 242
243### Tools that support it
244- Optimizely (Stats Accelerator)
245- VWO (SmartStats)
246- PostHog (Bayesian approach)

Tools that support it

  • Optimizely (Stats Accelerator)
  • VWO (SmartStats)
  • PostHog (Bayesian approach)
Raw lines 243 to 247
248### Tradeoff
249- More flexibility to stop early
250- Slightly larger sample size requirement
251- More complex analysis
253---

Tradeoff

  • More flexibility to stop early
  • Slightly larger sample size requirement
  • More complex analysis

Raw lines 248 to 254
255## Quick Decision Framework

Quick Decision Framework

Raw lines 255 to 256
257### Can I run this test?
259```
260Daily eligible traffic (randomization units): _____
261Fraction exposed to the experiment: _____
262Number of arms (including control): _____
263Allocation fraction for each arm: _____
264Baseline conversion rate: _____
265MDE I care about: _____
267Sample needed per variant: _____ (from tables above)
268Balanced allocation: Days = Sample per arm × Number of arms / (Daily eligible traffic × Exposure fraction)
269Unequal allocation: Days = max across arms of [Sample required for arm / (Daily eligible traffic × Exposure fraction × Arm allocation)]
270Round collection time up, then apply the minimum-duration rules above.
272If days > 60: Consider alternatives
273If days > 30: Acceptable for high-impact tests
274If days < 14: Likely feasible
275If days < 7: Easy to run, consider running longer anyway
276```
278**Duration check (illustrative):** with 2,000 participants required per arm and 1,000 eligible participants/day, two arms at 50/50 with full exposure require four days, not two. At 50% exposure they require eight days. With full exposure and 90/10 allocation, the smaller arm needs 20 days to reach 2,000. These are collection estimates; honor planned business cycles and the analysis stopping rule.

Can I run this test?

Daily eligible traffic (randomization units): _____
Fraction exposed to the experiment: _____
Number of arms (including control): _____
Allocation fraction for each arm: _____
Baseline conversion rate: _____
MDE I care about: _____

Sample needed per variant: _____ (from tables above)
Balanced allocation: Days = Sample per arm × Number of arms / (Daily eligible traffic × Exposure fraction)
Unequal allocation: Days = max across arms of [Sample required for arm / (Daily eligible traffic × Exposure fraction × Arm allocation)]
Round collection time up, then apply the minimum-duration rules above.

If days > 60: Consider alternatives
If days > 30: Acceptable for high-impact tests
If days < 14: Likely feasible
If days < 7: Easy to run, consider running longer anyway

Duration check (illustrative): with 2,000 participants required per arm and 1,000 eligible participants/day, two arms at 50/50 with full exposure require four days, not two. At 50% exposure they require eight days. With full exposure and 90/10 allocation, the smaller arm needs 20 days to reach 2,000. These are collection estimates; honor planned business cycles and the analysis stopping rule.

Raw lines 257 to 278