Sub topic 12
Testing more than two variants
This chapter assumes you can run a two-proportion z-test and read a p-value, as covered in the previous chapters. It shows what changes when you test three or more variants at once.
Why more variants create more false winners
A 5% significance level means a test with no real difference still declares a winner about 1 time in 20. Each extra comparison gives that false alarm another chance to happen.
If you run k independent comparisons at α = 0.05, the chance of at least one false positive is 1 − (1 − α)^k. This is the family-wise error rate.
| Variants (including control) | Comparisons against control | Chance of at least one false winner |
|---|---|---|
| 2 | 1 | 5.0% |
| 3 | 2 | 9.8% |
| 4 | 3 | 14.3% |
| 5 | 4 | 18.5% |
Comparing every pair is worse. Four variants give six pairs, and the false-winner chance rises to about 26%.
Decide the comparisons before you send
Pick the family of comparisons in advance. For most email tests, compare each variant against the control. Four subject lines then produce three comparisons, not six. Choosing comparisons after you see the data is a form of peeking and invalidates the correction.
The Bonferroni correction
The simplest fix is to divide α by the number of comparisons m. With three comparisons, each one must reach p < 0.05 / 3 ≈ 0.0167. Bonferroni is conservative, which means it can miss small real effects. For a handful of subject lines that cost is acceptable, and the rule is easy to explain.
from math import sqrt
from statistics import NormalDist
def two_proportion_p_value(success_a, sent_a, success_b, sent_b):
p_a = success_a / sent_a
p_b = success_b / sent_b
pooled = (success_a + success_b) / (sent_a + sent_b)
se = sqrt(pooled * (1 - pooled) * (1 / sent_a + 1 / sent_b))
z = (p_b - p_a) / se
return 2 * (1 - NormalDist().cdf(abs(z)))
control = (400, 20000) # clicks, recipients
variants = {"B": (430, 20000), "C": (480, 20000), "D": (445, 20000)}
alpha = 0.05
adjusted_alpha = alpha / len(variants)
for name, (clicks, sent) in variants.items():
p = two_proportion_p_value(*control, clicks, sent)
verdict = "significant" if p < adjusted_alpha else "not significant"
print(f"{name}: p={p:.4f} threshold={adjusted_alpha:.4f} {verdict}")Variant C has the largest lift and passes the corrected threshold. B and D have p-values well above 0.0167 and do not.
The cost in sample size
A stricter threshold raises the sample size you need. In the sample-size formula, z for α = 0.05 is 1.96. For α = 0.0167 it is about 2.39. With 80% power, the required recipients per variant grow by about a third, roughly (2.39 + 0.84)² / (1.96 + 0.84)². You also need a full group for each extra variant, so a four-way test needs about 2.7 times the total audience of a two-way test.
Practical guidance
- Test fewer, more distinct variants. Two or three strong subject-line ideas beat six near-duplicates.
- Keep one variable per test. Four subject lines is one variable. Four subject lines crossed with three send times is twelve cells and rarely fits a list.
- Name the primary comparison first. If one variant is your real hypothesis, test it alone and treat the others as exploratory.
- Treat unexpected winners as leads. A surprising result from a large family deserves a confirmation test before you roll it out.
Exercise
You test a control and five new subject lines, comparing each new line to the control at α = 0.05 with a Bonferroni correction. What p-value must a variant beat to be called a winner, and what is the main cost of this correction?
Show answer
There are five comparisons, so the threshold is 0.05 / 5 = 0.01. The cost is lower power: each variant needs more recipients to detect the same lift, and small real effects are more likely to be missed.