Sub topic 7
Pitfalls: small samples, cherry-picking, and averages that mislead
This chapter assumes you can compute CTR, CVR, CPA, and ROAS, and that you know what a baseline is. It also assumes you have seen the idea of a significance test. Here you will learn three common ways a correct calculation still leads to a wrong conclusion.
Pitfall 1: small samples
A rate based on few events moves a lot when one event changes. Suppose a new ad gets 4 conversions from 50 clicks (8% CVR), and your baseline is 4%. The ad looks twice as good. But one more or one fewer conversion changes the CVR by 2 points. The result is mostly noise.
Check the count of events behind each rate, not only the rate. A rough habit is to distrust any rate with fewer than about 30 to 50 conversions behind it. The z-test below shows how the same relative lift can be noise or signal.
from math import sqrt, erf
def two_proportion_z(conv_a, n_a, conv_b, n_b):
p_a, p_b = conv_a / n_a, conv_b / n_b
pooled = (conv_a + conv_b) / (n_a + n_b)
se = sqrt(pooled * (1 - pooled) * (1 / n_a + 1 / n_b))
z = (p_b - p_a) / se
p_value = 2 * (1 - 0.5 * (1 + erf(abs(z) / sqrt(2))))
return z, p_value
# Same 4% vs 5% CVR (a 25% relative lift), different sample sizes
for n in (500, 5000):
z, p = two_proportion_z(conv_a=int(n * 0.04), n_a=n, conv_b=int(n * 0.05), n_b=n)
print(n, round(z, 2), round(p, 3))With 500 visitors per variant the p-value is large, so the lift could easily be chance. With 5,000 it is small. The lift is identical. Only the sample size changed.
Pitfall 2: cherry-picking
Cherry-picking means reporting only the results that support a story. It often happens without bad intent. You slice a campaign by 20 segments and find one where the new creative wins. If you test 20 segments at a 5% false-positive rate, you expect about one false "win" even when nothing is going on.
Guard against it with these habits:
- Write down the primary KPI and the segments you plan to check before you look at results.
- Report every segment you checked, not only the winners.
- Treat a surprising segment win as a hypothesis for a new test, not as a finding.
- Do not stop a test the first moment it looks significant. Decide the run length in advance.
Pitfall 3: averages that mislead
An overall average can hide opposite trends inside it. This is known as Simpson's paradox: a variant can lose in every segment and still win overall, because the mix of traffic differs between variants.
| Segment | Variant A (conv / visits) | Variant B (conv / visits) |
|---|---|---|
| Mobile | 20 / 1000 (2.0%) | 5 / 300 (1.7%) |
| Desktop | 90 / 1000 (9.0%) | 240 / 3000 (8.0%)... |
Use a cleaner version of the same idea in code. Here B is lower in both segments but higher overall, because B received mostly desktop traffic, which converts better.
data = {
"A": {"mobile": (20, 1000), "desktop": (45, 500)},
"B": {"mobile": (4, 250), "desktop": (320, 4000)},
}
for variant, segments in data.items():
total_c = sum(c for c, n in segments.values())
total_n = sum(n for c, n in segments.values())
parts = {s: round(c / n, 3) for s, (c, n) in segments.items()}
print(variant, parts, "overall", round(total_c / total_n, 3))Output:
A {'mobile': 0.02, 'desktop': 0.09} overall 0.043
B {'mobile': 0.016, 'desktop': 0.08} overall 0.076B loses on mobile (1.6% vs 2.0%) and on desktop (8.0% vs 9.0%), yet its overall rate is nearly double. The cause is the traffic mix, not the creative. Compare variants within segments, or make sure each variant gets a similar mix.
Means also hide skew. If a few large orders drive revenue, average order value and ROAS look healthy while most customers spend little. Check the median and the spread alongside the mean.
Exercise
A new email gets 6 conversions from 80 sends (7.5%). Your baseline is 4%. A teammate says to scale it. Name two pitfalls from this chapter that apply, and what you would do.
Show answer
Small sample: only 6 conversions, so one more or fewer shifts the rate a lot, and a significance test on this size would likely not be conclusive. Possible cherry-picking too, if this email was chosen from several tried because it looked best. Do not scale yet. Keep the test running to a length set in advance, or confirm with a fresh test, then compare with the baseline using a significance test.