Skip to content
Start free

Stopping when it looks good

Simulate thousands of tests where nothing changes, peek after every batch, and see how often p < 0.05 appears anyway, then build a stopping rule that holds.

2 parts · 6 and 4 min

Free course. Your Maestro, an AI, .

In the checkout test from the previous module, the analysis was planned once, at a fixed 2,000 sessions per arm. When a live updates conversion counts every day, many teams instead check the after every batch and stop the moment p < 0.05 (|z| > 1.96), assuming that peeking is harmless as long as nobody changes the variants or traffic split.

Sample rates wobble from batch to batch even when both variants convert at 4%. A single test at 5,000 sessions per arm gives noise one chance to push the past 1.96. Checking after every 500 sessions per arm and stopping the first time |z| > 1.96 gives noise ten chances to cross that line. To stop early in without inflating false alarms, you must fix the looks in advance and raise the |z| cutoff so the chance of crossing it at any look stays at 5%.

Try it

In the exercise below, np.random.default_rng(2026) simulates 4,000 A/A tests where both arms convert at 4%, checked across 10 looks of 500 sessions per arm. Run the starter code to compare one look at the end (z[:, -1]) against stopping at the first look with |z| > 1.96.

Then calibrate two stopping boundaries from the 4,000 simulated paths so only 5% of null tests ever cross them:

  1. A constant boundary c: take the 0.95 quantile of each test's maximum |z| across the 10 looks, np.quantile(np.abs(z).max(axis=1), 0.95).
  2. An early-strict boundary C * np.sqrt(10 / k) for look k = 1, ..., 10: set C to the 0.95 quantile of (np.abs(z) * np.sqrt(k / looks)).max(axis=1). If the array shapes or quantile step feel tricky, ask your Maestro to walk through the code.

Your turn

Run the simulation. Then find a constant |z| boundary that, used at all ten looks, gives a 5% false-positive share, and a boundary of the form C * sqrt(10 / look) that does the same. You're done when you can explain why the first-p<0.05 rule fails and the calibrated ones do not.

A good place to stop. Up next: What the 4,000 simulated tests show · 4 min

What the 4,000 simulated tests show

With one planned look at the end (5,000 sessions per arm), |z| > 1.96 appeared in 0.053 of the 4,000 A/A tests. Stopping at the first of the 10 looks with |z| > 1.96 pushed the false-positive share to 0.188 (nearly one in five null tests), even though the test setup never changed. Armitage, McPherson and Rowe (1969) showed why repeated significance tests on accumulating data behave this way: each unadjusted look gives random wobble another chance to cross 1.96.

Stopping at the first p < 0.05 also exaggerates the effect size. Because early batches of 500 or 1,000 sessions per arm need a larger raw gap to reach |z| > 1.96, stopping on an early crossing locks in a random high spike.

Valid sequential designs fix the looks and boundary first

Checking data in batches is valid when the look schedule and an adjusted boundary are fixed before data arrive. Our seed-2026 simulation calibrated two classic boundary designs to a 0.05 overall false-positive share (these cutoffs come from our simulation run, not from the published tables in the papers):

  • Constant boundary (Pocock, 1977): Requiring |z| > 2.55 at all 10 looks keeps the overall false-positive share at 0.05, though even the 10th look must clear 2.55 instead of 1.96.
  • Early-strict boundary (O'Brien and Fleming, 1979): Using C * sqrt(10 / k) with C = 2.09 sets the cutoff at 6.62 on look 1 and relaxes it to 2.09 on look 10, also giving a 0.05 share. Only a huge early gap stops the test, and look 10 stays close to 1.96. Ask your Maestro when a team would pick the constant 2.55 rule over the early-strict boundary.

Critiquing a daily-peek stopping rule

Worked example · 3 steps

A team runs a checkout test for up to 5,000 sessions per arm in 10 batches of 500 sessions per arm at a 4% baseline. The analyst never changes the variants, but checks after every batch and stops the first time |z| > 1.96 (p < 0.05), claiming a 5% false-positive risk and reporting that batch's lift. Critique this rule and repair it.

Work out the next step yourself, then open it to compare.

Check yourself: An analyst wants the option to stop a 10-batch checkout test early if the redesign clearly wins or loses, while keeping the overall false-positive share at 0.05. Which plan achieves that?