Did the change work, or was it chance?
An A/B test answers whether a change made a difference. Sizing it, reading it and not peeking at it every day are what an analyst is paid to get right.
- Size a test before it starts
- Read a p-value and an interval
- Explain why peeking misleads
You need: Lesson 1.
- 1Statistics you use every day
- 2SQL that answers questions
- 3Charts that answer the question
- 4Power BI’s filter context
- 5A/B tests
- 6Guesstimates
-
Randomise, then compare
Predict first
Why split visitors at random, instead of comparing this month with last month?
Just show me
So that everything else (festivals, ads, the weather) hits both groups alike, and only the change differs.
Choose one primary metric before starting (the conversion rate, say), split traffic at random and run both versions at the same time. A before-and-after comparison mixes the change with everything else that changed.
Quick check
You launch a new checkout during Diwali and sales jump. Proof it works?
Without a control group, the festival and the change are tangled.
-
How many visitors?
Predict first
Conversion is 4%. To reliably detect a lift to 4.4%, how many visitors does each version need?
Just show me
39,475 per version, at 95% confidence and 80% power. Look for half that lift and it’s about 3.9 times as many.
Small rates and small lifts need big samples. Work the size out first, from today’s rate, the smallest lift worth finding, the confidence and the power, and run the test until it’s reached.
Size your own test in the A/B test calculator
Quick check
Traffic is 2,000 visitors a day, and the test needs 80,000 in all. How long?
80,000 ÷ 2,000 = 40 days; if that’s too long, test a bigger change or a busier page.
-
Reading the result
Predict first
400 of 10,000 converted on A and 452 of 10,000 on B: a 13% lift. Significant at 95%?
Just show me
No: p = 0.069, above 0.05. The 95% interval for B − A runs from -0.04 to +1.08 points, which includes zero.
The p-value is how surprising this gap would be if the versions were the same; the interval is how big the real difference might be. A big lift on small numbers can still be noise, and a tiny lift on huge numbers can be “significant” and still not worth shipping.
Quick check
p = 0.03, and the interval runs from +0.01 to +0.05 points. Ship?
Significant says “probably real”, not “worth it”.
-
Don’t peek and stop
Predict first
Check a test of two identical versions every day for 14 days, and stop at the first p below 0.05. How often do you “find a winner”?
Just show me
About 22%: 217 of 1,000 simulated A/A tests, against 48 when each is checked once at the end.
Every look is another chance for noise to cross the line. Fix the sample size and look once at the end, or use a method built for repeated looks (sequential testing).
Watch 1,000 A/A tests in the calculator
Quick check
Your manager wants daily results. Best answer?
Watching is fine; stopping early on a lucky day is what inflates false wins.
-
Guardrails and many metrics
Predict first
You track 20 metrics and one is significant at 0.05. A real win?
Just show me
Maybe not: at 0.05, about 1 test in 20 crosses the line by chance anyway.
Decide the primary metric in advance, add guardrail metrics that mustn’t get worse (refunds, load time), and treat surprises in the other metrics as ideas for the next test, not conclusions.
Quick check
What’s a guardrail metric?
It guards against a change that wins the goal and hurts something else.
Lesson 5 done.
Next: Guesstimates. Interviewers ask “how many UPI payments does a restaurant take on a Saturday?” not for the number but for how you reach it.
In the interview: A/B tests.
HardHow big a sample does an A/B test need?
HardWhy is peeking at an A/B test a problem?
MediumDesign an A/B test for a one-tap UPI checkout
HardYour A/B test tracks 20 metrics and one is significant. Is that a win?
MediumWhat is a p-value not?
Ask Prism about this lesson
Sources
- Kohavi, Tang and Xu, “Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing”, Cambridge University Press, 2020.
- Armitage, McPherson and Rowe, “Repeated Significance Tests on Accumulating Data”, Journal of the Royal Statistical Society, Series A, 1969.
- Our A/B test calculator, its own arithmetic for every number here.