Sub topic 14
Pitfalls: peeking, multiple comparisons and novelty effects
This chapter assumes you have read the earlier chapters on hypotheses, metrics, sample size and the experiment brief. You should know what a p-value and a 95% confidence interval are. You should also know that the brief fixes the planned sample size and the decision rule before launch.
Three mistakes account for many untrustworthy experiment results: looking at results too often, testing too many things at once, and reading early behavior as lasting behavior. None of them breaks the data. They break the inference. The data can pass every quality check and still lead to a wrong ship decision.
Peeking: checking results before the planned sample is reached
Peeking means looking at the p-value or confidence interval while the experiment runs and stopping when it looks good. A 5% false positive rate holds only if you run the test once, at the planned sample size. Each extra look is another chance for random noise to cross the significance line.
Take an A/A test, where both variants are identical. Noise makes the difference wander above and below zero. If you check ten times and stop the first time the result is "significant", you will often find a significant result that does not exist.
The simulation below runs many A/A experiments and compares two policies. One policy stops at the first significant look. The other tests once, at the end.
import numpy as np
from statistics import NormalDist
def peeking_false_positive_rate(n_sims=2000, looks=10, n_per_look=1000,
p=0.10, seed=7):
rng = np.random.default_rng(seed)
z_crit = NormalDist().inv_cdf(0.975)
peeked = 0
final_only = 0
n = n_per_look * np.arange(1, looks + 1)
for _ in range(n_sims):
c = rng.binomial(n_per_look, p, size=looks).cumsum()
t = rng.binomial(n_per_look, p, size=looks).cumsum()
pooled = (c + t) / (2 * n)
se = np.sqrt(2 * pooled * (1 - pooled) / n)
z = np.abs(t / n - c / n) / se
peeked += int((z > z_crit).any())
final_only += int(z[-1] > z_crit)
return peeked / n_sims, final_only / n_sims
peek_rate, final_rate = peeking_false_positive_rate()
print(f"stop at first significant look: {peek_rate:.3f}")
print(f"test once at the end: {final_rate:.3f}")Expect roughly 0.19 for the peeking policy and about 0.05 for the single test. Ten looks nearly quadruple the error rate you thought you had.
What you can do about peeking
You do not have to avoid looking at the experiment. You have to avoid acting on inference from those looks. There are three practical approaches:
- Fixed horizon. Write the planned sample and run time in the brief. During the run, monitor only health and guardrails. Read the primary metric once, at the end.
- Sequential testing. Use a method built for repeated looks, such as group sequential designs with alpha-spending or always-valid confidence sequences. The analysis platform must support it, and the data team must choose it before launch.
- Stopping for harm. A guardrail breach, such as a spike in payment errors, is a legitimate reason to stop early. Pre-agree the thresholds in the brief so the stop is a rule and not a judgment call.
Underpowered experiments make this worse. If the planned sample is too small for the minimum detectable effect, only unusually large random swings reach significance. Those swings overstate the true effect.
Multiple comparisons: too many questions, one alpha
Every hypothesis test at alpha = 0.05 has a 5% chance of a false positive when nothing is happening. If you test many things, the chance that at least one comes up "significant" grows quickly. Teams create many tests without noticing in several ways:
- many metrics (conversion, revenue, retention, clicks)
- many segments (country, platform, new vs. returning users)
- many variants (A/B/C/D/E)
- many time windows (day 1, week 1, week 2)
For m independent tests where nothing is truly happening, the chance of at least one false positive is 1 − 0.95^m.
| Number of tests | Chance of at least one false positive |
|---|---|
| 1 | 5.0% |
| 5 | 22.6% |
| 10 | 40.1% |
| 20 | 64.2% |
Slicing a flat result into twenty segments will usually produce a "winning" segment by chance alone. That is not a discovery. It is a pattern in noise.
Controlling the error rate
The first defense is structural. The brief names one primary metric and one decision rule. Guardrails are one-sided safety checks. Everything else is secondary and exploratory. The primary metric uses the full alpha, and exploratory results can only generate new hypotheses.
When several metrics or variants must be tested formally, correct the p-values. Bonferroni divides alpha by the number of tests. Holm's step-down procedure is never less powerful than Bonferroni and still controls the chance of any false positive. Here is Holm:
def holm(p_values, alpha=0.05):
"""Return {name: True/False} where True means reject the null."""
m = len(p_values)
ordered = sorted(p_values.items(), key=lambda kv: kv[1])
decisions = {name: False for name in p_values}
for rank, (name, p) in enumerate(ordered):
if p <= alpha / (m - rank):
decisions[name] = True
else:
break
return decisions
p_values = {
"checkout_completion": 0.004,
"revenue_per_user": 0.030,
"support_tickets": 0.200,
}
print(holm(p_values))With three tests, checkout_completion is rejected at 0.05/3 ≈ 0.0167. revenue_per_user is then compared with 0.05/2 = 0.025, and 0.030 fails. The output is {'checkout_completion': True, 'revenue_per_user': False, 'support_tickets': False}. Before correction, two of the three would have looked significant.
Segment analysis needs extra care. If you want a result for a segment, such as mobile users, write it in the brief as a planned analysis and size the sample for it. An unplanned segment result needs a follow-up experiment where that segment is the pre-registered question.
Novelty and primacy effects: early behavior is not steady behavior
Users react to change itself. A novelty effect is a temporary lift because a new design draws curiosity. A primacy effect is the opposite. Experienced users resist a change at first, then adapt, so early results understate the long-run benefit. Either way, the effect measured in week 1 can differ from the effect after users settle.
If you ship on the week 1 result of 1.8 points, you will plan around an effect that is really closer to 0.6 points and still falling.
How to detect and handle them
- Run for at least one to two full business cycles. For most products this means whole weeks, so weekday and weekend behavior are both represented. A test that runs 5 days overweights some days.
- Plot the effect over time. Show the daily or weekly difference with intervals, not only the cumulative number. A steady downward or upward trend is the signature.
- Split by user tenure. If the lift is concentrated in users who saw the change for the first time, it may be novelty. If new users, who have no habit to unlearn, show a stable effect, that is a good sign.
- Use a holdout. Keep a small group on the old experience after launch and keep measuring. This tells you whether the effect lasts.
- Match the metric to the horizon. Some outcomes, such as retention or repeat purchase, take weeks to show. If the decision depends on them, the planned duration must cover them, or the brief must name a short-term proxy and say why it is acceptable.
A cumulative plot hides this problem, because early days keep contributing to the average. Check each period separately.
Putting the safeguards in the brief
Each pitfall is easiest to prevent before launch. These fields belong in the brief:
| Pitfall | What to pre-register in the brief | Who checks |
|---|---|---|
| Peeking | Planned sample, run length, analysis date, rule for early stops | Data |
| Multiple comparisons | One primary metric, list of guardrails, correction method, planned segments | Product and data |
| Novelty effects | Minimum full weeks, time-series plot, tenure split, holdout plan | Data and product |
Engineering supports these by making sure the experiment cannot be quietly stopped, expanded or restarted without a record. Changing the traffic split mid-run or restarting assignment can invalidate the analysis in ways that look like a pitfall but are actually a data quality failure.
A short pre-read checklist
Before anyone reads the primary metric, confirm the following:
- The planned sample size or run date has been reached, or a sequential method is in use.
- The sample ratio mismatch check has passed.
- Only the primary metric drives the ship decision. Other results are labeled exploratory.
- Weekly effects have been plotted, and the trend is flat or understood.
- Any correction method named in the brief has been applied.
Exercise
A team tests a new onboarding screen with one primary metric (activation rate), four secondary metrics and five user segments. The plan is 14 days. On day 4, a dashboard shows that activation for the "Android, new users" segment is up with p = 0.03, and a teammate proposes shipping to everyone. Name the two pitfalls in this proposal and say what the team should do instead.
Show answer
The proposal combines peeking (acting on a result on day 4 of a 14-day plan) and multiple comparisons (the finding came from one of many unplanned segment and metric slices, with 5 segments × several metrics in play, so a p of 0.03 is expected by chance). The team should keep the experiment running to the planned end date, read only the pre-registered primary metric for the ship decision, and treat the Android result as a hypothesis for a follow-up experiment. They should also check for a novelty effect by plotting weekly lift and splitting by tenure before shipping.