Free account

Save your progress

Keep lessons, quiz scores and your certificate in sync across devices. Lessons you already finished in this browser are added automatically.

At least 8 characters.

By continuing you agree to our terms and privacy policy. We store your name, email and course progress. No spam.

Track 5 · Experimentation & CRO · Lesson 3 of 4

A/B Testing Statistics That Hold Up

Size tests correctly, understand power and significance, avoid peeking, catch sample ratio mismatch, handle novelty and multiple comparisons, and know when not to test.

TL;DR

Advanced 18 min
  • Fix sample size and duration before launch from baseline rate, minimum detectable effect, 95% confidence and 80% power. Then do not stop early.
  • Checking significance every day and stopping at the first green result can push your real false-positive rate far above 5%. Use a sequential method if you must look.
  • Run a sample ratio mismatch check on every test. If the split is off, the result is not trustworthy, however good it looks.
  • More variants and more metrics mean more false wins. Correct for it or pre-register one primary metric.
  • Low traffic, irreversible changes and obvious fixes are all reasons not to A/B test.
KPIs it moves
  • Sample size per variant
  • Statistical power
  • p-value
  • Sample ratio mismatch rate
  • False discovery rate
Best for
  • B2B SaaS
  • E-commerce / D2C

Why this matters

An A/B test is a measuring instrument. If the instrument is miscalibrated, every decision built on it is wrong, and you will not know. A team shipping “wins” that are really noise will see its dashboard full of green results while the business metric stays flat. That gap destroys trust in experimentation faster than any losing test.

Most statistical failures in growth teams come from a handful of causes: too little sample, stopping early, broken randomisation, too many comparisons and novelty effects. Each one is easy to prevent once you know what to look for. This lesson gives you the arithmetic and the checks. For the button-pressing part, use the A/B test calculator.

The framework

Every test balances four numbers. Fix three and the fourth is determined.

QuantityWhat it meansTypical setting
Significance level (alpha)Chance of declaring a winner when there is no real difference (false positive)5%, two-sided
Power (1 − beta)Chance of detecting a real effect of the size you care about80%
Minimum detectable effect (MDE)Smallest real change you want to reliably detectSet by business value and traffic
Sample size per variantUsers needed in each groupCalculated

A p-value is the probability of seeing a difference at least this large if the change truly had no effect. It is not the probability that your variant is better. A p-value of 0.03 means “this would be surprising if nothing were going on”, nothing more.

The sample you need grows with the square of how precise you want to be. Halving the MDE needs four times the traffic. That single fact explains why low-traffic sites cannot test small tweaks.

Where you put the primary metric matters just as much. Each funnel step shrinks the volume you can test on. Drag the sliders to see how few orders a 100,000-visitor month really produces.

  1. Monthly visitors 100,000 users
  2. 60,000 users
    60% step conv. · −40,000 lost
  3. 7,200 users
    12% step conv. · −52,800 lost
  4. 3,960 users
    55% step conv. · −3,240 lost
  5. 2,376 users
    60% step conv. · −1,584 lost

Overall conversion: 2.4% (2,376 of 100,000 users)

Weakest step: Add to cart converts only 12% of the previous stage (Product page view), losing 52,800 users.

Testing on orders gives about 2,400 conversions a month here. Testing on add-to-cart gives 7,200, so smaller effects become detectable.

Step-by-step playbook

  1. Get the baseline right. Pull the last four full weeks of the primary metric for exactly the audience the test will include. Exclude internal traffic and bots. Use users, not sessions, as the unit if you randomise by user.
  2. Choose the MDE from value, then check feasibility. Ask what lift would justify the cost of shipping and maintaining the change. Then compute sample size. If the duration is over six to eight weeks, change the test, not the statistics.
  3. Round duration up to whole weeks. Weekday and weekend behaviour differ, especially for B2B. Minimum one week; two is safer.
  4. Decide your stopping rule before launch. Either fixed horizon (look once at the end) or a sequential design with pre-set looks and boundaries. Write it in the test brief.
  5. Run an A/A or pilot first on new set-ups. When you change tools or tracking, run control versus control for a week. It should show no significant difference and no SRM.
  6. Check SRM on day one and at the end. Compare observed assignment counts with the configured split using a chi-square test.
  7. Read the primary metric once, then guardrails, then segments you pre-registered. Report the confidence interval, not just the p-value. “Plus 4%, interval plus 1% to plus 7%” says more than “significant”.
  8. Check for novelty. Plot the daily effect. If it starts high and decays, extend the test or analyse only users who were new during the test.

Worked example

Sample size

Say a D2C apparel brand converts 4.0% of checkout-page visitors and wants to detect a 10% relative lift, to 4.4%. It gets 3,000 eligible visitors a day.

  • p₁ = 0.040, p₂ = 0.044, so δ = 0.004.
  • Variance terms: 0.04 × 0.96 = 0.0384 and 0.044 × 0.956 = 0.042064. Sum = 0.080464.
  • Multiply by 7.84: 0.080464 × 7.84 = 0.63084.
  • Divide by δ² = 0.000016: 0.63084 ÷ 0.000016 ≈ 39,428 visitors per variant.
  • Total for two variants: 78,856. At 3,000 a day: 78,856 ÷ 3,000 ≈ 26.3 days.
  • Round up to whole weeks: 28 days.

The shortcut gives 16 × 0.0384 ÷ 0.000016 = 38,400 per variant, within 3% of the exact figure. Good enough for planning.

If the brand wanted to detect a 5% lift instead, δ halves to 0.002 and the sample quadruples to roughly 155,000 per variant, more than three months of traffic. That test should not run.

SRM check

At the end, the 50/50 test shows 50,600 users in control and 49,400 in treatment, out of 100,000.

A 1.2% imbalance sounds trivial, but it is far too large to be chance at this sample size. Something removed users unevenly: a redirect that loses some visitors, a variant that breaks on one browser, or bot filtering that reacts to the change, as in the MSN carousel case below.

Peeking and sequential testing

Fixed-horizon statistics assume you look once. Each extra look is another chance for noise to cross the line. Statistician Evan Miller showed that if you stop a no-difference test at the first significant reading, the real false-positive rate in his worst-case example climbs to 26.1%, more than five times the nominal 5%. He also calculated that with 10 interim looks, you would need a per-look threshold of roughly 1% to keep the overall rate near 5%.

You have three honest options:

  • Do not peek at significance. Watch only SRM and guardrails for breakage.
  • Group sequential design. Pre-plan, say, three looks with stricter boundaries early (O’Brien-Fleming style) and the normal threshold at the end.
  • Always-valid inference. Some platforms use methods such as the mixture sequential probability ratio test that stay valid at any look. Read your tool’s documentation to know which you have.

Five traps and how to spot them

Symptom: winners that shrink or vanish after launch.

  • Fix the horizon or use a sequential method.
  • Hide p-values until the planned sample if your team cannot resist.

Multiple comparisons, novelty and when not to test

Multiple comparisons. With four variants each compared to control at 5%, the chance of at least one false winner is 1 − 0.95⁴ ≈ 18.5%. Track ten metrics and it is 1 − 0.95¹⁰ ≈ 40%. A Bonferroni correction for ten metrics uses 0.05 ÷ 10 = 0.005 per metric. It is conservative but simple. Guardrails do not need correction if they can only veto, not approve, a launch.

Novelty and primacy. Returning users react to anything new, and some resist anything different. Both fade. A new recommendation widget may get clicks for a week because it is new. A redesigned navigation may dip for a week while people relearn it. Check the daily effect and segment by new versus returning users.

When not to A/B test:

  • Traffic cannot reach your MDE in about six to eight weeks.
  • The change is a bug fix, legal requirement or clear accessibility improvement.
  • The decision is irreversible or strategic, such as a rebrand or a price change for existing customers, where network or press effects contaminate groups.
  • Users can see each other’s variants, as in marketplaces or social products. Use cluster or geo randomisation instead.
  • You would ship it regardless of the result. Then just ship and monitor.

B2B SaaS vs D2C: what changes

FactorB2B SaaSD2C / e-commerce
Randomisation unitAccount, so colleagues see the same variantUser or device; watch for logged-out to logged-in switching
Typical trafficLow; MDEs of 15 to 30% are commonHigher; 5 to 10% MDEs are often feasible
Weekly cycleStrong weekday pattern, weekends near zeroWeekend and payday spikes, sale events
Lagging outcomesPaid conversion can take 14 to 30 days; use activation as primary and follow upReturns and cash-on-delivery refusals arrive days later; report net revenue once they settle
ContaminationSales team may treat leads differently if they know the variantDiscount codes leak across variants on coupon sites

Avoid testing during major sale events such as Diwali or Black Friday unless the test is about the sale itself. Behaviour is unusual and results rarely generalise.

How to measure it

  • Sample size per variant: users assigned to each group at analysis time, counted once each, by the randomisation unit.
  • Conversion rate per variant: users with at least one target event within the attribution window, divided by users assigned. Use an intention-to-treat view: everyone assigned counts, whether or not they saw the change.
  • Relative lift with 95% interval: (treatment rate − control rate) ÷ control rate, reported with its confidence interval.
  • SRM rate: tests failing the SRM check divided by tests run, per quarter. If yours is far above the roughly 6% Microsoft reported, audit your set-up.
  • Post-launch holdback: for important wins, keep 5 to 10% of users on control for a few weeks after launch to confirm the effect persists.
Case study · Microsoft Experimentation Platform

Case study: How often A/B tests are quietly broken: sample ratio mismatch at Microsoft and LinkedIn

  • About 6% Microsoft A/B tests with SRM
  • About 10% LinkedIn zoomed-in tests with SRM (historically)
  • 12 to 16 cards MSN carousel change that triggered SRM
  • 25+ Products studied in the KDD paper

Microsoft's Experimentation Platform team published a guide in September 2020 on diagnosing sample ratio mismatch (SRM), where the share of users in each variant differs from the split you configured. They report that a recent analysis at Microsoft found about 6% of A/B tests had an SRM, and that at LinkedIn about 10% of zoomed-in A/B tests used to suffer from this bias. One example they describe is an MSN test that increased the number of rotating cards in an image carousel from 12 to 16. Users in the treatment engaged so heavily that a bot-detection algorithm flagged some of them and filtered them out, which removed the most engaged users from one side and skewed the result. The underlying KDD 2019 paper by Fabijan and colleagues draws on experience across four software companies and more than 25 products, and likens an SRM to a fever: a symptom of many possible data problems. The practical rule is simple. Check SRM before you read any metric, and if it fails, find the cause instead of trusting the lift.

Sources: Diagnosing Sample Ratio Mismatch in A/B Testing (Microsoft Research, Sept 2020) · Diagnosing Sample Ratio Mismatch in Online Controlled Experiments (KDD 2019 paper summary)

Pitfalls vs pro moves

What amateurs do What top 1% growth teams do
Launch the test and 'run it until it's significant'. Compute sample size from baseline, MDE, alpha and power before launch, round the duration up to whole weeks and commit to it.
Check the dashboard daily and stop the day it shows 95% confidence. Either wait for the planned sample, or use a sequential method (group sequential boundaries or always-valid p-values) that is built for repeated looks.
Never look at how many users landed in each variant. Run a chi-square SRM check on assignment counts before reading results, and treat a p-value under 0.001 as a stop-and-debug signal.
Test six variants against control on fifteen metrics and ship whatever is green. Limit variants, pre-register one primary metric and apply a correction such as Bonferroni or Benjamini-Hochberg to the rest.
Ship a feature after a strong first week of engagement. Plot the daily treatment effect over time and look for a decaying novelty curve. For high-change UX, run longer or analyse new users separately.
A/B test everything, including a broken checkout button. Fix obvious bugs directly, use pre-post or holdouts when traffic is too low, and reserve A/B tests for genuine uncertainty.

Knowledge check

Knowledge check

3 questions · pick an answer to see the reasoning

  1. Q1. Your test was planned for 40,000 visitors per variant. On day 5, with 9,000 per variant, the dashboard shows variant B ahead with p = 0.03. Your CMO wants to ship today. What do you do?

  2. Q2. A 50/50 test shows 50,600 users in control and 49,400 in treatment. The treatment wins by 4% on conversion. What is the right next step?

  3. Q3. A B2B SaaS pricing page gets 1,500 visitors a month with a 2% trial rate. The team wants to test a new headline. What is best?

Sources

  1. How Not To Run an A/B Test (Evan Miller)
  2. Diagnosing Sample Ratio Mismatch in A/B Testing (Microsoft Research)
  3. Diagnosing Sample Ratio Mismatch in Online Controlled Experiments (paper page)
  4. The Surprising Power of Online Experiments (HBR)

Updated