04

Noise, and how to read it

Every number a test produces is subject to random fluctuations (read: wobbles). This chapter builds, one step at a time, the single calculation behind every result in the rest of the book: how big the wobble is, and whether a difference is bigger than it.

Part one argued that you need experiments. (Every term below is also in the glossary.) Part two is about running them well, and nearly all of it rests on one idea, met briefly in chapter 0: two groups never behave exactly alike, even when they see the same thing. This chapter measures that leftover wobble, the noise, and turns it into the three numbers every dashboard shows: a difference, a p-value and an interval. Each step uses one running example: a shop where 4% of visitors buy, and a test with 95,000 visitors in each version.

Why numbers wobble

Picture the four thousand people who reach your checkout today.

Each of them is in the middle of a life. One gets a phone call from her mother and closes the laptop. One realises his card is in the other jacket. One is on a bus in the rain, looks up at the right moment, sees someone through the window, and forgets what he was buying. One was going to buy anyway, whatever the page looked like. One is a bot.

None of that has anything to do with your design, and all of it decides whether a purchase happens. Over a crowd, these thousands of small accidents roughly cancel out, which is why a shop’s conversion rate is fairly stable from week to week. But roughly is not exactly. Split today’s visitors into two random groups and show both the same page, and one group will still convert a little better than the other, purely because of who happened to get the phone call and who happened to look out of the window.

That leftover difference is noise, also called random variation. It is not a measurement error and it does not go away with better tools. It is what happens when you count people. Every A/B test is an attempt to see the effect of a change through it.

An A/A test: the same page, measured twice

How to read itTwo groups of 1,000 visitors each, split at random and shown exactly the same page. A test where both groups see the same version is called an A/A test; teams run them on purpose to check their tools (chapter 8). Nothing is blue because nothing differs. The numbers are an illustration.

€48Add to basket★★★★☆ 212 reviews
Group 135 of 1,000 bought: 3.5%
€48Add to basket★★★★☆ 212 reviews
Group 246 of 1,000 bought: 4.6%
What it showsIdentical pages, and one group still bought almost a third more than the other. Nothing caused that difference except who happened to be in each group that day. Any test of a real change has this wobble underneath it.

A real-world example: boys and girls

Noise is not special to websites. Around the world about 105 boys are born for every 100 girls, so a little over 51% of babies are boys, year after year. That is as stable as a fact about people gets. Yet any one day in any one hospital can look very different. The psychologists Daniel Kahneman and Amos Tversky used this to show how badly people judge noise: asked whether a small or a large hospital records more days on which over 60% of the babies are boys, most people answer that it makes no difference.

One month of births in two hospitals

How to read itEach dot is one day: the share of that day’s babies who were boys. The dashed line is the true share, 51%. The blue band holds the days with more than 60% boys, and those days are drawn in blue. The births are simulated from the true share; only the size of the hospital differs.

A small hospital: about 15 births a day 25% 50% 75% more than 60% boys: 5 days of 30 A large hospital: about 45 births a day 25% 50% 75% more than 60% boys: 3 days of 30
What it showsThe small hospital wanders far more, because each day it counts only about 15 babies: two or three more boys than usual are enough to cross 60%. Over a year it records about 63 such days, against about 33 for the large hospital. Nothing about the babies differs between the two, only how many are counted. A test with few visitors is the small hospital.

Noise has one friendly property: the more people you count, the more the accidents cancel out. Below, two groups see exactly the same page with a true conversion rate of 4%. Watch their measured rates as visitors accumulate.

More people, less wobble

How to read itLeft to right, more and more visitors: each step is ten times more people. The two lines are the conversion rate measured in each group so far. The grey band is the noise: where 95% of measurements land at that number of visitors, even though both groups see the same page. Watch the band, and the gap between the lines, shrink as people are added.

group Agroup B
After 100 visitors each
—
After 1,000 visitors each
—
After 100,000 visitors each
—

Same page, same true rate of 4% (the dotted line). With 100 visitors the band reaches 3.8 points either side of 4%; with 100,000 it is 0.12 points.

With a hundred visitors each, two identical groups can look very different. With a hundred thousand, they agree to the second decimal. The rest of this chapter puts a number on the width of that band.

How many people would you ask?

Forget websites for a moment. You want to know who will win your country’s next election.

Would you stop five random people in the street and ask them? Obviously not: three of them might happen to vote the same way, and you would announce a landslide.

Would you ask ten million? That would work, but it is wildly more than you need. A poll of about 1,000 randomly chosen voters pins the result down to within about 3 percentage points either way, nineteen times out of twenty. Ten million voters would narrow that to 0.03 points, a precision nobody needs, at ten thousand times the cost.

How far off a poll can be, by how many you ask

How to read itA candidate truly has 50% of the vote, the dashed line. Each blue bar is the range in which a poll of that size lands nineteen times out of twenty.

0% 25% 50% 75% 100% 5 people±44 points 100±10 points 1,000±3.1 points 10,000±1.0 points 10 million±0.03 points
What it showsWith five people the poll can say almost anything. By 1,000 the bar has shrunk to 3 points either side. Going from 1,000 to ten million makes it invisible on this scale, and nobody needed that. Each step down the chart asks ten or more times as many people for a smaller and smaller gain.

Why does the bar shrink, and why so slowly? Each person asked is an independent draw. Some lean one way by chance and some the other, and the more draws you add, the more those chance leanings cancel each other out. They cancel slowly, though: the bar narrows with the square root of the number of people asked, so a hundred times as many people makes it only ten times narrower. That is why the first thousand people buy almost all the precision, and the next ten million buy almost none.

Two lessons that carry over to A/B tests

1 · How many you ask, not how many exist. 1,000 voters give the same margin in a small country as in a huge one, just as 100,000 visitors give the same precision whether your site has a million users or a billion. Think of tasting soup: one spoonful tells you how salty it is, whether it comes from a small pot or a huge vat, as long as the soup has been stirred. Picking people at random is the stirring.

2 · Who you ask matters more than how many. In 1936 the magazine Literary Digest mailed about ten million straw-poll ballots, got about 2.4 million back, and predicted a landslide defeat for Franklin Roosevelt. George Gallup, with a far smaller but better-chosen sample, predicted his re-election, which is what happened. The usual story blames the Digest’s mailing lists, drawn largely from telephone and car owners. Later studies of who actually replied, by Peverill Squire in 1988 and Dominic Lusinchi in 2012, found the bigger problem was who chose to answer: Landon’s supporters were keener to send their ballots back. It is the self-selection of chapter 1 at national scale.

1936: the biggest poll, the wrong answer

How to read itEach bar is Franklin Roosevelt’s share of the vote, counting only him and his rival Alf Landon. The first two bars are predictions made before the election, the Literary Digest’s from 2.4 million replies and Gallup’s from about 50,000 people; the third is what happened.

  1. Literary Digest43%
  2. Gallup56%
  3. The election62%
What it showsThe Digest had about fifty times as many answers as Gallup and missed by almost 20 points, because the people who chose to reply were not like the people who voted. Gallup chose his sample and missed by 6. A bigger sample cannot fix the wrong people; it only makes the wrong answer more precise.

A huge self-selected sample loses to a modest random one. In experiments, the coin toss is what keeps the sample unbiased (chapter 0); the rest of this chapter is about the “how many”.

From one visitor to an average

To know whether 4.20% really beats 4.00%, you first need to know how far 4.00% would move on its own, if you ran the same test again with different people. That depends on two things only: how much one visitor varies, and how many visitors are averaged. Four short steps get from one to the other, each with a picture.

1 · A rate is an average

Give every visitor a 1 if they bought and a 0 if they did not. The conversion rate is the average of those ones and zeros: 4% means 4 ones in every 100.

Twenty-five visitors as ones and zeros

How to read itEach square is a visitor. The blue one bought and counts as 1; the others did not and count as 0.

0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 25 visitors: one bought (1), the others did not (0) average = 1 ÷ 25 = 0.04 = 4%
What it showsAdd up the ones and divide by the number of visitors, and you get the conversion rate. Everything that follows treats a rate as an average, which is why the same arithmetic works for rates and for amounts such as spend.

2 · One visitor varies a lot

Any single visitor is either a 0 or a 1, never 0.04. How far a typical visitor sits from the average is called the standard deviation. For a yes-or-no behaviour at 4% it is about 0.2, or 20 percentage points: five times the rate itself. For an amount, such as spend per visitor, it is often larger than the average. The variance is the same thing squared. It sounds like an extra word for nothing, but variances can be added together and standard deviations cannot, so the formulas are written with it.

Where one visitor can land

How to read itThe line runs from 0, did not buy, to 1, bought. Each dot is a visitor; 24 pile up at 0 and one sits at 1. The blue line is the average of all of them.

0 · did not buy 1 · bought the average, 0.04 typical distance from it: about 0.2 nobody is ever 0.04: every visitor is a 0 or a 1
What it showsThe average sits close to 0, but no visitor is ever there: each one is a whole 0 or a whole 1. The typical distance between a visitor and the average, about 0.2, is the standard deviation. It is large compared with the 4% rate itself.

3 · An average of many visitors varies much less

Average 95,000 visitors and most of their accidents cancel. How much the average itself would wobble if you repeated the test with new people is its standard error: the standard deviation of one visitor divided by the square root of the number of visitors. Here that is 0.2 divided by about 308, or 0.064 points. The square root is the reason precision is expensive: four times the people only halves the wobble.

Forty groups at three sizes

How to read itEach dot is one simulated group of visitors, all with a true conversion rate of 4%, the dashed line. Each row has forty groups of the same size: 100, 1,000 and 10,000 visitors.

0% 4% 8% 12% groups of 100 groups of 1,000 groups of 10,000 each dot is the conversion rate of one group
What it showsGroups of 100 land anywhere from 0% to about 9%. Groups of 1,000 stay within about a point. Groups of 10,000 sit almost on the line. The spread of each row is the standard error at that size, and it shrinks with the square root of the group: ten times the people, only about a third of the spread.

4 · The wobble has a shape

If you could rerun the same test thousands of times, the averages would pile up in a bell shape around the true value: most very close, a few further out, almost none very far. This happens for averages of almost any behaviour, buying or not, spending a little or a lot, once there are enough people; mathematicians call it the central limit theorem. The bell is what makes noise calculable. About 95% of the pile lies within 1.96 standard errors of the centre, which is where the grey band above and every “95%” in this book come from.

2,000 repeats of one test

How to read itEach bar counts how many of 2,000 simulated tests with 10,000 visitors measured a conversion rate in that narrow range. The smooth curve is the bell the bars approach. The blue bars are the middle 95%.

−1.96 SE 4.00% +1.96 SE 95% of the averages land between the two marks
What it showsThe repeats pile up in a bell around the true 4.00%: most land close, a few further out, almost none far away. That shape is what lets a single test say how surprising its result is.

The same bell, narrower with more people

How to read itThe true conversion rate is 4%. Each curve is the pile of measured rates you would get by repeating a test of that size many times; the shaded part holds 95% of them, and its two ends are written under the size. The curves are drawn to the same height so their widths can be compared.

1,000 visitors2.8% to 5.2% 10,000 visitors3.6% to 4.4% 95,000 visitors3.9% to 4.1% 3% 4% 5%
What it showsNothing about the visitors changes from one curve to the next, only how many of them are averaged. With 1,000 a measured rate anywhere from 2.8% to 5.2% is unremarkable. With 95,000 it has to fall between 3.9% and 4.1%. That narrowing is the standard error shrinking, and it is the only reason a test can see a small difference.

The difference between two groups

An A/B test compares two averages, so what matters is the wobble of their difference.

Each group wobbles on its own, and the two wobbles add up: the variance of the difference is the variance of A’s average plus the variance of B’s. In the running example the standard error of the difference comes out at 0.091 points.

Now the result. A converted 4.00% of its visitors, B 4.20%. B is 0.20 points ahead. Is the difference bigger than the noise? Divide the difference by its standard error: 0.20 / 0.091 = 2.2. The difference is 2.2 standard errors from zero. That ratio is called z, and every test result in this book is, underneath, a z.

Two bells, and the bell of their difference

How to read itTop: where each group’s measured rate could have landed, given its 95,000 visitors. Bottom: one curve for the difference between two such groups when the change does nothing. It is centred on 0 and wider than either curve above, because two wobbles are added. The blue line is the difference this test measured.

The two groups A: 4.00%B: 4.20% 3.8% 4.0% 4.2% 4.4% Their difference, if the change did nothing measured: +0.20, 2.2 standard errors out −0.20 0 +0.20 B minus A, in percentage points
What it showsThe two curves at the top overlap only at their edges, which is the picture of “probably not the same”. The bottom curve puts a number on it: a difference of 0.20 points is 2.2 standard errors from zero. The small red areas, beyond 0.20 on either side, are how often noise alone gets that far. The next section gives that area its name.

Percent and percentage points

The same result can be written two ways. From 4.00% to 4.20% is +0.20 percentage points, the absolute change, and +5%, the relative change, because 0.20 is 5% of 4.00. Dashboards mix the two freely and the difference matters: “+5%” and “+5 points” are a twenty-five-fold disagreement at a 4% baseline. This book uses relative changes unless it says points.

The null hypothesis: start by assuming nothing changed

A test never proves your idea. It can only show that “nothing changed” has become hard to believe.

To judge a z of 2.2, a test starts from the opposite assumption to the one you hope for: that the change made no difference at all. This starting assumption is the null hypothesis, and it is the most important idea in this chapter.

It works like a trial. The change is presumed to do nothing until the evidence makes that hard to believe. Nobody has to prove it innocent; the data have to make “it did nothing” look unreasonable. And as in a trial, failing to convict is not the same as proving innocence: a test that finds nothing has not shown that the change does nothing, only that the evidence was not strong enough.

Why argue backwards like this? Because “nothing changed” is the one claim precise enough to calculate with. If it were true, z would wobble around zero in the bell shape above, and it is possible to say exactly how often it would land 2.2 or more away. No such calculation exists for “my design is better”, which does not say by how much.

So be precise about what a significant result says. It does not demonstrate that B is a success. It says that the null hypothesis has been rejected: the difference is too big to have been caused by noise alone. Whether B is good enough to ship is a separate question, answered by the size of the effect, which the interval later in this chapter shows.

The p-value: how surprising, if nothing changed

The p-value is the number every testing tool prints next to a result. First the idea, with a coin; then the same idea for a test; then what it is for.

The idea, with a coin

A friend offers you a bet on a coin, and you suspect it is loaded. You toss it ten times and get nine heads. Is it loaded? Start from the null hypothesis, that the coin is fair, and ask how often a fair coin does something this extreme: nine or ten heads, or, just as surprising, nine or ten tails. The answer is about 2 times in 100. That number is a p-value. It is small, so “the coin is fair” has become hard to believe.

Ten tosses of a fair coin

How to read itEach bar is how often a fair coin gives that number of heads in ten tosses. The red bars are the results at least as extreme as nine heads, in either direction, with how often each happens.

0 0.1% 1 1.0% 2 3 4 5 6 7 8 9 1.0% 10 0.1% 24.6% heads in 10 tosses of a fair coin
What it showsFive heads is the most common result, about one time in four. Nine or more heads, or nine or more tails, happens 2.1 times in 100 in all. That total of the red bars is the p-value of nine heads.

The same idea for a test

A test works the same way, with the bell curve of differences in place of the coin’s bars. The p-value answers one question: if the change did nothing, how often would chance alone produce a difference at least this far from zero, in either direction? For a z of 2.2 the answer is about 3 times in 100: p = 0.03. Move the slider to see how the answer depends on how far out the result sits.

Where your result sits if B did nothing

How to read itThe curve is every result a test of this size could give if B did nothing at all: most land near 0, a few further out. The blue line is your result; drag the slider to move it. The red areas are the do-nothing results at least as far from 0 as yours, on both sides, like the red bars of the coin. The p-value is the share of the curve that is red: push your result further out and the red, and the p-value, shrink.

Your measured difference+5.0%
results if B did nothingyour resultat least as extreme as yours

— p-value

Baseline conversion 4%, 95,000 visitors per version. The curve is what tests of a change that does nothing would show; the red tails are results at least as extreme as yours.

Why it matters in a test

The p-value decides whether a result gets called significant, which is the next section. Two misreadings are common enough to name now. A p-value of 0.03 does not mean there is a 3% chance that B is no better: it describes what noise does if B did nothing, not how likely that is. And it says nothing about size: a tiny, useless difference gets a small p-value if enough people were counted. For size you need the interval, later in this chapter.

Significant: what the word means, and what it does not

Significant means hard to explain by noise alone. It does not mean big, and it does not mean certain.

By convention, a result with p below 0.05 is called significant: too far out to be comfortably explained by noise, so the null hypothesis is set aside. In everyday speech the word means “important”. Here it means only “unlikely to be chance”: a tiny, useless difference can be significant if enough people were counted, and a large, valuable one can fail to be if too few were (chapter 9). The 0.05 is the significance level, written α (alpha). It is a promise about changes that do nothing: test many of them and about 5% will still come out significant. Those are false wins (and false losses).

False wins and missed wins

The opposite mistake is a real improvement that does not come out significant: a missed win. How often a test avoids it, for an improvement of a given size, is the test’s power; the convention is 80%, so one real improvement in five of that size is missed. The size the test is planned around, and how many people that takes, is the subject of chapter 6. Statisticians call false wins type I errors and missed wins type II errors; this book uses the plain names.

Why 5% and 80%? Habit, mostly. The statistician Ronald Fisher suggested one in twenty as a convenient line in the 1920s, and 80% power became the usual partner later. Neither is a law of nature. Ron Kohavi and colleagues argue for a stricter line, such as 1%, when most ideas fail, because that is when false wins crowd out real ones; others accept 10% for cheap, easily reversed changes. Both numbers are settings in the planner: choose them for the decision, before the test.

Neither number says how likely it is that a particular significant result is real. That also depends on how often your ideas work at all, which is why chapter 2 found that about one celebrated win in five is noise even with a 5% line.

The interval: what sizes the data allow

The p-value only measures distance from zero. The more useful summary is a range.

Take the measured difference and go 1.96 standard errors either side: 0.20 ± 0.18 points, which is +0.02 to +0.38 points, or +0.5% to +9.5% in relative terms. This is the 95% interval, also called a confidence interval.

How to read an interval

How to read itEvery result in this book is drawn like this, so it is worth one slow look. Start at the top: version A converted 4.00% of its visitors and version B 4.20%. B did 0.20 points better, which is 5% better than A. Below, that 5% becomes the dot, on a scale of how much better B did; the line around it is the interval.

3.8% 3.9% 4.0% 4.1% 4.2% 4.3% 4.4% A · 4.00% B · 4.20% 0.20 points apart: 5% of 4.00% rate
The dot: what the test measured
B did 5.0% better than A, with these particular visitors. Run the test again with different visitors and you would get a slightly different number, because of noise.
The line: the sizes the data allow
The measured difference, 1.96 standard errors either side: here +0.5% to +9.5%. It is the range of true differences these data are compatible with. The promise behind it is about the method: if you drew intervals this way for many tests, about 95 in 100 would contain the real difference.
The dashed line at 0: no difference
If the line crossed it, “B is no better than A” would still be compatible with the data. Here the whole line is to the right of 0: the test rules out no change at the 5% level. That is what “significant” means, and it is the same verdict as p below 0.05.
The blue line at +3%: worth shipping
The smallest improvement that would pay for the change, chosen before the test (chapter 6). Here the line crosses it: B might be worth it, or might be better by too little to matter. Chapter 9 shows what to do then.

The picture takes a few examples to get used to. Here are four tests drawn the same way.

Four intervals, four readings

How to read itEach row is one test, drawn like the one above: the dot is what the test measured, the line is the range of sizes the data allow, the dashed line is 0, no difference. Look first at where the line sits against 0, then at how long it is.

  1. The running example +5.0%, interval +0.5% to +9.5% clear of 0 The whole line is right of 0: B is better, by somewhere between a little and a lot.
  2. Half the visitors +5.0%, interval −1.4% to +11.4% crosses 0 Same dot, longer line, because fewer people were counted. 0 is inside: the test cannot tell B from A.
  3. Thirty times the visitors +5.0%, interval +4.2% to +5.8% clear of 0, short So many people that the line is short. B is better by about 4% to 6%, and that is pinned down.
  4. A change that hurts −4.5%, interval −7.0% to −2.0% clear of 0, below The whole line is left of 0: B is worse. That is a finding too.

how much better B did than A

What it showsThe first three tests measured the same +5%, and they say very different things. The length of the line is set by how many people were counted: half the visitors and the line crosses 0, thirty times the visitors and it is short enough to pin the size down. The position says which way: the last line sits entirely below 0, so B made things worse.

The interval answers two questions at once. Does it exclude zero? Then the result is significant. Does it exclude the size you care about? Then you know whether the change is worth it. A p-value can only answer the first.

And an interval that includes zero, say −1.2% to +6.0%, does not mean “no effect”. It means the test could not tell. A real 3% improvement might be hiding in there, along with a small loss. “Not significant” is an absence of evidence, never evidence of absence.

One side or two

The p-value above counts surprises in both directions: a result as far below zero as yours is above it counts too.

That is a two-sided test, and this book uses it throughout, because a change that makes things worse is something you want to detect, not ignore. A one-sided test looks in one direction only, and needs about a fifth fewer people for the same power. It is legitimate only when a result in the other direction would lead to exactly the same decision as no result, and when that choice is written down before the test. Switching to one-sided after seeing the data halves the p-value and doubles the false wins.

Where the 5% goes

How to read itEach curve shows where the result of a test can land, counted in standard errors from zero. The black curve is a change that does nothing: its results scatter around 0. The blue curve is a real improvement of the size the test was planned for. A dashed line is where a result starts to be called significant. Red is the share of do-nothing changes that land beyond a line anyway; the blue shading is the share of real improvements that do.

Two-sided −1.96 +1.96 0 no change a real improvement 80% 2.5% 2.5% One-sided +1.64 0 no change a real improvement 88% 5%
false wins and false lossesreal improvements found: the power
What it showsTwo-sided, the 5% is split: 2.5% beyond each line, with the lines 1.96 standard errors out, and the test finds 80% of real improvements. One-sided, the whole 5% sits on the right, so the line moves in to 1.64 and the same test finds 88%; or it keeps 80% with about a fifth fewer people. The price is on the left: there is no line there any more, so a change that makes things worse can never come out significant.

Which one you need

Ask what you would do with a clear loss. If that differs from what you would do with no result at all, you need two sides. In product work it nearly always differs. The picture shows why with one real loss; the list after it gives the three usual reasons.

The same loss, read both ways

How to read itOne test, one set of data: the new checkout took 4.5% fewer orders than the old one, which puts the result 3.5 standard errors below 0. Both panels show the bell of results a test gets when B does nothing, counted in standard errors from 0, and the red line where this test landed. The dashed lines are where a result starts to count as significant; red areas are the 5% of do-nothing results that cross a line anyway.

Two sides: a line on each side −1.96 +1.96 0 this test −4.5% Beyond the left line: B is worse, by 2% to 7%. One side: a line only on the right +1.64 0 this test −4.5% No line on this side: filed as “not a win”, like 0.
What it showsThe data are identical; only the lines differ. With two sides there is a line on the left, the loss lands far beyond it, and the test reports a finding: B is worse, by somewhere between 2% and 7%. With one side there is no line on the left, so even a loss this clear ends up where a change that did nothing would: “not a win”. If a loss like this would send you back to the design, or stop the same idea from going out elsewhere, you need two sides.

One side is enough when a loss and a flat result lead to exactly the same action, and nobody will ask which of the two it was. The clearest case is a check that something must not get worse: “page speed must not fall by more than 2%” only looks in one direction (chapter 9). Another is a change you will drop unless it wins and will never build on, such as a paid placement that is cancelled unless revenue goes up. Even then, write “one-sided” in the plan before the test starts.

One place where the book counts only one side on purpose is chapter 2’s share of false wins: a false loss is never celebrated, so only the 2.5% of do-nothing tests that come out significantly positive can masquerade as wins.

Many comparisons, many false wins

The 5% promise holds for one comparison. Every extra comparison is another chance for noise to cross the line.

Three variants, each against the control, and a change that does nothing anywhere: if the three comparisons were independent, the chance that at least one comes out significant would be 1 − 0.95 × 0.95 × 0.95, about 14%. Because the three share the same control group they are not quite independent, and simulation puts the real figure at about 12.5%. Either way it is well over 5%, and twenty metrics or ten segments make it far worse.

The chance of at least one false alarm

How to read itEvery change here does nothing. Each bar is the chance that at least one comparison still comes out significant, if the comparisons are independent of each other.

  1. 1 comparison5%
  2. 3 comparisons14%
  3. 5 comparisons23%
  4. 10 comparisons40%
  5. 20 comparisons64%
What it showsOne comparison keeps the 5% promise. Three, such as three variants against a control, already break it. Twenty, such as twenty metrics read off one dashboard, make a false alarm more likely than not: two times in three, something will look significant when nothing happened.

The simplest repair is the Bonferroni correction: divide the 5% by the number of comparisons and use that stricter line for each. With three variants, each needs p below 0.0167. It is slightly stricter than necessary, which is the price of being simple. The cost in people is in chapter 6.

Every extra variant costs traffic: one more group to fill, and a stricter line for each.

Put the two costs together. Each new variant needs its own group of visitors, and the stricter Bonferroni line makes every group bigger than it would be in a plain A/B test. Take the shop of chapter 6, where an A/B test of the same change takes two weeks:

Weeks to run, by number of new versions

How to read itEach row is a number of new versions tested against A at once, from a plain A/B test to five. The bar is how long the test takes with the same traffic, the same smallest effect worth finding and the same 80% chance of finding it, when the 5% is shared out between the comparisons with Bonferroni.

  1. 1 · A/B2 weeks
  2. 2 · A/B/C3.6 weeks
  3. 3 · A/B/C/D5.3 weeks
  4. 47.1 weeks
  5. 58.9 weeks
What it showsThree new versions take more than five weeks instead of two; five take about nine. Before adding a variant, ask whether it is worth the extra weeks, or whether it should be the next test instead.

Which test this is, and where it stops working

Everything in this chapter so far is one particular calculation. It is worth knowing its name, what it assumes, and what analysts use when the assumption fails. None of it changes how you read a result.

The calculation is a z-test: the difference divided by its standard error, read against the bell curve. The book uses it for rates and for averages alike, and so do the tools. It leans on the central limit theorem, so it is accurate when there are enough people for the averages to be bell-shaped. For rates, that means at least a few hundred conversions in each group; for amounts with a long tail, such as spend, many thousands of visitors.

When the bell appears, and when it does not

How to read itSpend per visitor in the example shop: 4% of visitors buy, the average order is €60, and a few orders are much larger. Each chart is 3,000 simulated groups; each bar counts how many groups had that average spend per visitor. The dashed line is the true average, €2.40.

Averages of 200 visitors €0 €2.40 €5 €8 Averages of 20,000 visitors €1.80 €2.40 €3
What it showsWith 200 visitors a group contains about eight orders, and one large basket moves the whole average: the pile is lopsided, with a long tail to the right, and the bell-curve arithmetic gives wrong answers. With 20,000 visitors the pile is a bell, and the z-test is accurate. For a plain yes-or-no rate the bell arrives much sooner.

The alternatives, and why you can leave them to the analyst

When the z-test’s assumption does not hold, or a team has other needs, analysts reach for another test. These are the ones you are most likely to hear named:

TestWhat it doesWhen analysts use it
t-testThe z-test with a small correction for estimating the spread from the data itselfSmall groups. At the sizes of web tests it gives the same answer as the z-test
Chi-square testCompares the counts in a table with what “no difference” would predictRates, sometimes several versions at once. For two groups it gives the same p-value as the z-test
Exact testCounts every way the buyers could have fallen into the two groups, with no bell curveRates with very few conversions
Mann–Whitney testCompares which group tends to have the larger values, rather than the averagesAmounts with extreme values; it answers a slightly different question
BootstrapResamples the data thousands of times to see how much the result movesLong-tailed amounts, and metrics such as medians or ratios
Bayesian analysisReports the probability that B is better, given the data and a starting beliefTeams that prefer that phrasing; the starting belief has to be agreed first
Sequential testMoves the line so a result can be checked several times while the test runsTests that must be watched as they go (chapter 7)

Whatever the analyst picks, the outputs mean the same things: a difference, a p-value, an interval. The question behind all three is still whether the difference is bigger than the noise. The choice of test changes the arithmetic, slightly, in the hard cases; it does not change what the team decides with the answer, so for designers and product managers it can stay out of sight. What they should know is that a choice was made, and that it was made before the test, not after seeing which test gives the nicest p-value.

The test is the analyst’s choice. The questions stay yours: how big, how sure, and is it worth it?

The maths

For a rate p, one visitor’s variance is p(1 − p) and the standard error of a group’s rate is

SE=p(1−p)n
Slowly, with numbers

In wordsMultiply the rate by one minus the rate, divide by the number of people, take the square root.

p
The rate, as a fraction: 4% is 0.04.
p(1 − p)
How much one visitor varies: 0.04 × 0.96 = 0.0384. It is largest at 50% and small for rare things.
n
The number of people in the group. 95,000.
SE
Standard error: how far the measured rate typically lands from the true one.

With numbers0.0384 / 95,000 = 0.000000404. Its square root is 0.00064, which is 0.064 percentage points: a measured 4.00% is typically within a few hundredths of a point of the truth.

For an average with standard deviation σ it is σ/√n. For the difference of two independent groups, variances add:

SEd=pA(1−pA)nA+pB(1−pB)nB
Slowly, with numbers

In wordsWork out the same quantity for each group, add the two, then take the square root. You add what is under the root, the variances, never the standard errors themselves.

A, B
The small letters say which group a number belongs to.
d
The difference between the two rates, B minus A.
SEd
The standard error of that difference.

With numbersA: 0.04 × 0.96 / 95,000 = 0.000000404. B: 0.042 × 0.958 / 95,000 = 0.000000424. Sum: 0.000000828. Square root: 0.00091, or 0.091 points. Wider than either group’s own 0.064, because two wobbles are in it.

With d = pB − pA, the z-score, the two-sided p-value and the 95% interval are

z=dSEd p=2(1−Φ(|z|)) d±1.96SEd
Slowly, with numbers

In wordsThree readings of the same result: how many standard errors it is from zero, how often noise alone gets that far, and the range of sizes the data allow.

z
The difference divided by its standard error: 0.0020 / 0.00091 = 2.20.
|z|
The bars mean “ignore the sign”: −2.2 and +2.2 both count as 2.2.
Φ
Capital phi. Not something to calculate by hand: a lookup. Give it a number of standard errors and it returns the share of the bell curve to the left of that point. Φ(2.20) = 0.986. In a spreadsheet it is NORM.S.DIST(2.2, TRUE).
1.96
The point with 2.5% of the bell beyond it on each side, so 95% lies between −1.96 and +1.96.

With numbers1 − 0.986 = 0.014 is the tail to the right of 2.20. Twice that, to count the same tail on the left, is the p-value: 0.028.

The interval: 1.96 × 0.00091 = 0.0018, so 0.0020 ± 0.0018, from 0.0002 to 0.0038. Divide by the 4% baseline to get +0.5% to +9.5%.

where Φ is the area of the standard bell curve to the left of a point, and 1.96 is the point that leaves 2.5% in each tail. In the running example: SEd = √(0.0400 × 0.9600 / 95,000 + 0.0420 × 0.9580 / 95,000) = 0.00091, z = 0.0020 / 0.00091 = 2.20, p = 0.028, interval +0.0002 to +0.0038, which divided by the 4.00% baseline is +0.5% to +9.5%.

A poll is the same formula for one group: at p = 50%, 1.96 × √(0.25 / 1,000) = ±3.1 points. The population size does not appear anywhere.

Three variants against one shared control, all doing nothing: the three z-scores are correlated with coefficient 0.5, and the chance that at least one exceeds 1.96 in absolute value is 12.5% (simulation), against 1 − 0.95³ = 14.3% for independent comparisons. Bonferroni uses α/k per comparison and keeps the family below α.

What we’ve learned

  • Two groups always differ a little by chance. That noise can be calculated, and it shrinks with the square root of the number of people.
  • Standard deviation is how much one person varies; standard error is how much an average of many people varies.
  • Averages pile up in a bell shape, so a difference can be measured in standard errors: that is z.
  • The p-value says how surprising the result would be if nothing changed. It is not the chance the change works.
  • The 95% interval is the difference ± 1.96 standard errors: the sizes the data allow.
  • Percent and percentage points are different; this book uses percent unless it says points.
  • Use two-sided tests, and tighten the line when you make several comparisons.

Sources

  • Freedman, D., Pisani, R. and Purves, R. (2007). Statistics, 4th edition. W. W. Norton. Standard errors, the central limit theorem, tests and intervals, explained without calculus.
  • Squire, P. (1988). Why the 1936 Literary Digest poll failed. Public Opinion Quarterly 52(1). And Lusinchi, D. (2012). “President” Landon and the 1936 Literary Digest poll: were automobile and telephone owners to blame? Social Science History 36(1).
  • Kohavi, R., Tang, D. and Xu, Y. (2020). Trustworthy Online Controlled Experiments. Cambridge University Press. Chapter 17, The Statistics behind Online Controlled Experiments.
  • Kahneman, D. and Tversky, A. (1972). Subjective probability: a judgment of representativeness. Cognitive Psychology 3(3). The hospital problem.
  • Goodman, S. (2008). A Dirty Dozen: Twelve P-Value Misconceptions. Seminars in Hematology 45(3).
  • Georgiev, G. Z. (2019). Statistical Methods in Online A/B Testing. On one-sided tests and multiple comparisons.