Find a course

Module 4: A/B Testing in PracticeLesson 9 of 1115 min

Analyzing A/B Test Results

Check for sample ratio mismatch, avoid peeking and multiple comparison traps, read lifts with confidence intervals, and make a sound ship decision.

Step 1 of 13Learn

The test that won on day three

A test of a new homepage showed revenue per visitor up 4.2% with p = 0.04. The team shipped it. Over the next two months, revenue per visitor was flat.

Looking back, the analyst found how the result had been produced. The dashboard updated every morning, and the team had checked it daily. On days one and two the result wasn't significant. On day three it was, and they stopped. They had planned to run for two weeks.

This is the peeking problem, and it's one of several ways an honest-looking A/B test result can be wrong. Analyzing a test is not just plugging numbers into a formula. It is a sequence of checks, each of which can invalidate what comes after it:

  1. Is the experiment healthy? Did randomization work, and did users get the experience they were assigned?
  2. Did anything break? Are the guardrail metrics stable?
  3. What is the effect on the primary metric? Estimate it with a confidence interval, at the planned end of the test.
  4. Is it worth acting on? Compare the plausible range of the effect with the cost and the MDE.
  5. What else did we learn? Explore segments and secondary metrics, labeled as exploratory.

This lesson goes through these steps and the traps that sit between them.

Step 2 of 13Learn

Check the split first: sample ratio mismatch

If you assigned users 50/50, you should see close to equal numbers in each group. A sample ratio mismatch (SRM) is when the observed split differs from the planned one by more than chance allows. It is a red flag that something in the experiment is broken, and when it happens, the results usually can't be trusted, however good they look.

Common causes: the new version crashes on some browsers so those users never get logged, a redirect drops some treatment users, bots are filtered differently in the two groups, or the assignment code has a bug.

To check, use a chi-square goodness-of-fit test: χ² = Σ (observed − expected)² / expected. With 100,000 users and a 50/50 plan, expected counts are 50,000 each. If you observed 50,800 and 49,200:

χ² = 800²/50,000 + 800²/50,000 = 12.8 + 12.8 = 25.6

With one degree of freedom, values above 3.84 are significant at 0.05, and 25.6 corresponds to a p-value below 0.000001. A 50.8/49.2 split looks harmless to the eye, but with this many users it is almost impossible by chance.

Many teams treat SRM checks as a hard gate: if p < 0.001, the test is not analyzed until the cause is found and fixed.

Step 3 of 13Practice · Work it out

A 50/50 test has 20,000 users in total: 10,300 in control and 9,700 in treatment. What is the chi-square statistic for sample ratio mismatch?

Step 4 of 13Practice · Diagram

Analyze in this order

Each check can invalidate everything after it.

Which check comes first, because a failure there makes every later number untrustworthy?

Tap the shape that answers the question, then press Check.

Analyze in this orderProcess diagram: Sample ratio check → Guardrail metrics → Primary effect and CI → Worth acting on?.Sample ratiocheckGuardrailmetricsPrimaryeffect and CIWorth actingon?
Sample ratio check

Did randomization split users as planned?

Guardrail metrics

Did anything break: errors, load time, refunds?

Primary effect and CI

Estimated at the planned end, with its interval.

Worth acting on?

Compare the plausible range with the cost of shipping.

Step 5 of 13Learn

Peeking and multiple comparisons

Peeking. A p-value is valid for a test analyzed once, at a sample size fixed in advance. If you check results every day and stop the first time p dips below 0.05, you give chance many opportunities to cross the line. Simulations show that frequent peeking can multiply the false positive rate several times over, so a nominal 5% becomes 20% or more. The solutions: fix the sample size and look only at the end, or use sequential testing methods designed for continuous monitoring, which adjust the thresholds to keep the error rate at 5%. Looking at the dashboard for bugs and guardrail problems is fine; making the ship decision mid-test is not.

Multiple comparisons. Each extra metric, variant or segment is another chance for a fluke. If you test 20 independent metrics at α = 0.05 and nothing really changed, the probability that at least one comes out significant is 1 − 0.9520 ≈ 64%. Slice results by device, country, new versus returning users and day of week, and you'll almost always find a segment where the change "worked".

Defenses: decide one primary metric before launch and base the decision on it. Treat other metrics and segments as exploratory, to be confirmed in a follow-up test. When you do need several formal tests, adjust the threshold; the simple Bonferroni correction uses α / m for m tests, such as 0.05 / 5 = 0.01 for five metrics.

Step 6 of 13Practice · Work it out

A test tracks 10 independent metrics at α = 0.05, and in truth the change affects none of them. What is the probability that at least one metric shows a significant result? Give a percentage rounded to the nearest whole number.

Step 7 of 13Chart

More metrics, more false alarms

Chance that at least one metric looks significant when the change affects none of them, at α = 0.05 each.

More metrics, more false alarmsLine chart with 6 categories: 1: 5%; 2: 9.8%; 5: 22.6%; 10: 40.1%; 20: 64.2%; 50: 92.3%.0%20%40%60%80%100%125102050Number of independent metrics
Calculated as 1 − 0.95k.
More metrics, more false alarms
Number of independent metricsChance of at least one false positive
15%
29.8%
522.6%
1040.1%
2064.2%
5092.3%

Step 8 of 13Practice · True or false

Checking an A/B test dashboard daily and stopping as soon as the result becomes significant keeps the false positive rate at 5%.

Step 9 of 13Practice · Chart

A p-value checked every day

One illustrative null test (no real effect). Stopping the first time p dips below 0.05 would declare a winner on day 3.

Tap the only day a peeking team would have stopped and declared a win.

Tap the point that answers the question, then press Check.

A p-value checked every dayLine chart with 14 categories: Day 1: p-value 0.41, α = 0.05 0.05; 2: p-value 0.12, α = 0.05 0.05; 3: p-value 0.04, α = 0.05 0.05; 4: p-value 0.09, α = 0.05 0.05; 5: p-value 0.22, α = 0.05 0.05; 6: p-value 0.35, α = 0.05 0.05; 7: p-value 0.18, α = 0.05 0.05; 8: p-value 0.27, α = 0.05 0.05; 9: p-value 0.44, α = 0.05 0.05; 10: p-value 0.38, α = 0.05 0.05; 11: p-value 0.52, α = 0.05 0.05; 12: p-value 0.47, α = 0.05 0.05; 13: p-value 0.61, α = 0.05 0.05; 14: p-value 0.58, α = 0.05 0.05.00.20.40.6Day 1357911130.040.05
Illustrative. Under the null a p-value wanders randomly; checking daily gives it many chances to cross the line.
A p-value checked every day
Itemp-valueα = 0.05
Day 10.410.05
20.120.05
30.040.05
40.090.05
50.220.05
60.350.05
70.180.05
80.270.05
90.440.05
100.380.05
110.520.05
120.470.05
130.610.05
140.580.05

Step 10 of 13Note

Step 11 of 13Learn

From result to decision

At the planned end of a healthy test, look at the primary metric's effect estimate and confidence interval, not just the p-value. Then compare the interval with two reference points: zero, and the minimum effect that would be worth shipping.

  • The whole interval is above the worthwhile threshold: strong case to ship.
  • The interval is above zero but includes small, unprofitable values: the change probably helps, but by how much is uncertain. Ship if it is cheap and low-risk, or test longer.
  • The interval straddles zero: inconclusive. The change could help, hurt or do nothing. Decide on other grounds, such as simplicity, cost or strategy, or run a larger test.
  • The interval is entirely below zero: the change hurts. Don't ship, and learn why.

Check the guardrails at the same time. A primary win paired with a clear guardrail loss, such as slower pages or more refunds, needs a deliberate trade-off decision.

Then write it up: hypothesis, design, sample sizes, SRM check, effect with interval, guardrails and decision. Include tests that lost or were inconclusive. A searchable archive of past experiments, including failures, is one of the most valuable things a testing program produces, because it stops teams from retesting ideas that already failed.

Step 12 of 13Practice · What would you do?

What would you do?

A test of a new recommendation widget ends at its planned sample size. The SRM check passes, guardrails are stable, and the effect on conversion is +0.9 percentage points with a 95% interval from −0.3 to +2.1 points. Maintaining the widget costs little. What is the most accurate conclusion?

Step 13 of 13Practice · Choose one

A team pre-registers 5 metrics it will formally test and wants to keep the overall chance of any false positive near 5%. Using the Bonferroni correction, what significance threshold should each metric use?