Experiment design and the readout
Size the test before it runs, write down how the decision will be made, and report a result with its interval and its limits, so that 'p = 0.06' becomes a recommendation and not an argument
A four-week buyer-level test finds orders per buyer up 3.1% with p = 0.06 on the primary metric. Which statement about that p-value is correct?
Metrics and experiments teaches the product manager’s side of a test: the metrics tree, the A/B vocabulary, the sample-size formula and the usual ways a test lies. This chapter is the other chair. The data scientist is the person who is asked to design the test, check that it is healthy, and write the readout that a leader will act on. If you have not read the PM chapter, start there; the sizing formula and the peeking problem are not re-taught here. The PM chapter owns experiments as product practice, and this one owns the statistical design and the readout.
The model: a decision made in advance
An experiment is a way to make one decision with better evidence. It has three documents, and each has a different reader.
| Document | Written | Reader | What it settles |
|---|---|---|---|
| Design | Before launch | The product owner, engineering, finance | Unit, population, primary metric, guardrails, size, duration, decision rule |
| Health check | Days 1 to 2, and again at the end | You and engineering | That the split, logging and exposure are working |
| Readout | After the planned end | The person who owns the decision | What happened, how sure we are, what to do, what we still cannot say |
Most disputes at the readout were avoidable at the design. The questions people ask on Friday (“is p = 0.06 good enough?”, “should margin have been the main metric?”, “can we run it longer?”) have answers that are cheap to agree on a month earlier and expensive to agree afterwards, because afterwards everyone has a preferred result. The design is where you agree on the rules while nobody knows who will win. Think of it as the experimental version of the question brief in asking the right question: the decision, the words, and the evidence that would change the choice, written down first.
Designing the test: six choices
1. The decision. Name who decides, by when, and what the options are. For the threshold: Ojaline’s growth lead decides whether to move more cities to ₦15,000. Without this, you cannot say what a good result looks like.
2. The unit. Randomise by buyer, not by order or by session. A buyer who sees ₦15,000 on Monday and ₦25,000 on Thursday is not a clean exposure, and a threshold is exactly the kind of offer people compare. Then analyse at the same level. If you analyse orders as if each were an independent observation when buyers place several, the standard errors come out too small and the p-values too kind. The unit of analysis follows the unit of randomisation.
3. The population. Say who is in and who is out, and say what the result can be generalised to. A Lagos test is a Lagos result. Lagos buyers are likelier to be repeat buyers and to live near a hub than buyers in a smaller city. If the next decision covers six cities, the design should say how far a Lagos answer travels, and the readout should repeat it.
4. The primary metric, the guardrails and the exchange rate. Pick one primary metric and a few guardrails before launch, and for a proxy write down the exchange rate. Growth chose orders per buyer because the hypothesis was behavioural: a lower threshold makes people order more. That is reasonable, and orders per buyer is far less noisy than margin. But orders are not what pays. A lower threshold means more free deliveries, and a free delivery costs Ojaline’s fleet money. So the design needs one more sentence: how much margin per buyer would Ojaline give up for how many extra orders? Without it, the readout becomes a vote on what the metrics mean.
5. Size and duration. Work out the smallest effect the test can see, before you launch. The next section does this for Ojaline.
6. The decision rule. Write, in advance, what you will do for each region of the result. For example: ship if the orders interval excludes zero and the margin interval stays above the agreed floor; extend once, by a fixed length, if the orders interval barely includes zero; stop if the margin interval sits wholly below the floor. It does not need to be elaborate. It needs to exist before the numbers do.
Sizing the test, and what Ojaline’s test could see
The formula and the table are in the PM chapter. The data scientist’s job is to apply it to the metrics the decision rests on, not only the primary one, and to say the answer in terms the owner cares about.
Take the Lagos test, the same one that the analysis memo works from, with illustrative numbers. Each buyer places about 2.90 orders in four weeks, with a standard deviation of about 6.9, because a few heavy buyers pull the spread up. The test had about 41,000 buyers per arm. The standard error of the difference in mean orders is 6.9 × √(2 ÷ 41,000), which is about 0.048 orders, or about 1.65% of the baseline.
| Quantity | Value | How it follows |
|---|---|---|
| Observed lift | +3.1% (0.09 orders per buyer, 2.90 to 2.99) | The result |
| 95% interval | −0.1% to +6.3% | Lift ± 1.96 standard errors |
| p-value | about 0.06 | The lift is 1.9 standard errors from zero |
| Power for a true +3.1% | about 47% | Roughly a coin toss |
| Smallest lift seen with 80% power | about 4.6% | 2.8 standard errors |
| Buyers per arm for 80% power at +3.1% | about 91,000 | About 2.2 times what was run |
Read the bottom three rows together. If the lower threshold truly raises orders by 3.1%, a test this size would reach p < 0.05 about half the time. A p of 0.06 is therefore not a surprise and not a failure. It is the ordinary outcome of a test that was never large enough for the effect it was looking for. Had anyone run this table before launch, the conversation would have been: do we accept a test that can only see a 4.6% lift, or do we wait for four times the traffic, or do we change the design?
The same arithmetic applies to the guardrail, and it is the part most teams skip. Margin per buyer is noisier than orders. Suppose its mean is ₦3,250 per buyer over the four weeks and its standard deviation about 2.7 times that (an illustrative figure; use your own from the data). Then the test’s margin standard error is about 1.9%, the 95% interval on the observed −0.4% runs from about −4.1% to +3.3%, and the smallest margin change the test could see with 80% power is about 5.3%. So “margin was not significantly down” says almost nothing. A true fall of 3% would have been detected only about a third of the time. A guardrail with no power calculation reassures without protecting anyone.
Two levers help before you launch. You can reduce variance with CUPED (controlled-experiment using pre-experiment data), the method of Deng, Xu, Kohavi and Walker at Microsoft (2013, in the reading), which adjusts each buyer’s metric using their own behaviour before the test. If a buyer’s earlier orders correlate 0.5 with their orders during the test, the variance falls by 25%, the correlation squared, which is worth about a third more buyers. And you can choose the metric with care: a metric closer to the decision costs sensitivity, a proxy gains it, and the exchange rate in the design keeps the proxy honest.
Health checks, in brief
The PM chapter explains each check. Run them on the first two days and again at the end. Sample ratio: Lagos had 41,060 buyers in control and 40,940 in treatment, a chi-square of 0.18 (p = 0.68), so nothing is wrong. Exposure: did the banner show to every treated buyer, and only to them? A/A, if the instrumentation is new. A failed check ends the reading.
Reading the result: p = 0.06
The American Statistical Association’s 2016 statement on p-values, written by Ronald Wasserstein and Nicole Lazar, makes the points you need at a readout. A p-value says how incompatible the data are with one specified model, usually “no difference”. It does not measure the size of an effect or its importance. And a decision should not rest on whether a p-value clears a fixed line. So the readout reports the effect and its interval first: “+3.1% orders per buyer, 95% interval −0.1% to +6.3%”. The interval says what the test supports: from about nothing to a large lift, centred on a useful one.
Now the four moves that the Friday meeting has available. Each is right in some circumstances.
Ship. Right when the change is cheap to reverse, the evidence leans the right way, and waiting has a cost. A delivery threshold is a configuration value. The interval on orders is mostly above zero, and the downside on margin is bounded and visible. Shipping is a decision under uncertainty, not a claim that the test proved the lift.
Extend. Right when the extension was planned. A sequential design or a second look written into the plan keeps the error rate honest. An extension decided after seeing p = 0.06 is a second peek. Two looks at a 5% threshold, if the second is allowed to rescue the first, with the second look after 50% more data, give an overall false-positive rate of about 6% in a simulation, not 5%. A first result between 0.05 and 0.10 crosses 0.05 on the second look about one time in five even when there is no effect at all. One extension is a small distortion. A habit of extending near misses is a large one.
Call it inconclusive. True, and sometimes the right call: when being wrong is expensive or hard to undo, such as a price change that will drive customer expectations. But it is not a decision, and the owner still has to do something. “Inconclusive” belongs in the readout together with a recommendation and a plan for getting a clean answer.
Re-run with margin as the primary metric. Changing the primary metric after seeing the data is the classic fork in the path: you pick the metric on which the story looks best, or worst, and the p-value no longer means what it says. A new test with margin as the primary metric, designed with a proper power calculation, is a different thing and can be exactly right. At Ojaline’s numbers it needs far more buyers than one city offers, which is why the next point matters.
A rollout with a holdout is an experiment. The question that pays is margin per buyer, which the Lagos test could not read. A staged rollout to six cities, with a randomly chosen share of buyers kept on ₦25,000, is a larger test with more buyers per arm than Lagos had, and it costs only the margin on the buyers held back. So the data scientist’s recommendation for a reversible change on a near miss is often: ship, keep a holdout, and agree the read-out date and stop rule now. It turns a decision on thin evidence into the next experiment. (In the analysis memo, growth shipped without one. That chapter starts from the world where nobody asked for it, and this one is the Friday on which you would.)
When the thing you test is a model
Some changes you test are models: a ranking change, Ojaline’s delivery-time model in a data scientist’s week, a prompt. Score a fixed evaluation set offline first, as the AI Engineering chapter on offline and online evaluation and A/B tests teaches. The online test then asks a different question: whether real buyers behave better, not whether the model scores better. An online metric can reward the wrong behaviour, such as clicks, so choose guardrails that catch it.
Where practitioners disagree
Frequentist or Bayesian. Frequentist readouts give an interval and a p-value against a fixed sample size. Bayesian readouts give the probability that the lift exceeds some value, given a prior. They are easier for owners to use (“a 90% chance the lift is positive”) and easier to misuse, because someone chose the prior. Say which you used and write it into the design.
One primary metric or a composite. One metric forces clarity. A composite of orders and margin matches the decision better but hides a trade-off inside a formula. Many teams settle on one primary metric, guardrails with stated floors, and the exchange rate in prose.
Fixed horizon or sequential. Fixed-horizon tests are simple to run and explain. Sequential methods let you stop early without inflating errors, and suit teams that look at results daily. If your team will look every day whatever you say, build for that.
Significance as a gate or as an input. A firm rule that nothing ships without p < 0.05 is auditable and refuses cheap reversible wins. Treating the interval as one input to a judgement about cost and reversibility is efficient and leans on the decider. Know which culture you work in, and say so in the readout.
Where it goes wrong
No design. The test starts, and the metrics and decision rule are invented at the readout. Every number then supports somebody.
Reading a guardrail as safe. “Not significant” is not “no change”. Compute what the guardrail could see.
Slicing until something is significant. Growth asks for the result by city, by category and by new versus returning buyers. Twenty cuts will give one at p < 0.05 by chance. Name subgroup analyses in advance, and label the rest as ideas for the next test.
Novelty. Buyers react to a new offer because it is new. Plot the lift by week. Lagos shows +4.4%, +3.6%, +2.8% and +1.6% (illustrative); each weekly interval is wide enough to hold a flat line, so the data cannot say whether the lift is fading, which is another reason for a holdout.
Interference. Ojaline’s riders are shared. If the treatment raises orders, riders in treated areas get busier, and delivery times for control buyers in the same city can lengthen. The arms are not independent, and the measured gap may be too small or too large. Say so as a limit, or randomise by area if the decision justifies the sample cost.
The readout as a verdict. You are not the judge. You report what the evidence supports and recommend. The owner decides, and the owner may reasonably weigh things you cannot.
Day to day
Per experiment, before launch: the design review. Forty-five minutes with the product owner, an engineer and, for a money metric, finance. You bring the sizing table, the guardrail power check and a draft decision rule. This is where most of the value is. Finance and growth agree the margin definition here, so that the readout does not turn into an argument about it.
Days 1 and 2: health only. Check the split, the exposure and the logging. Agree that nobody acts on the primary metric. If something is broken, stop and fix it; a clean restart costs a few days, and a bad test costs the decision.
At the planned end: the readout. Run the analysis you wrote down, check the weekly pattern, and write one page. Present it in the weekly experiment review where one exists, and put it where the next analyst will find it. Allow thirty minutes to present and up to a day to write.
After the decision: the log. Add the experiment to a shared log with the design, the decision rule, the result and what was decided. Every month or so, read it. Which tests were underpowered? Which shipped changes later reversed? Many teams find that their win rate falls with honest measurement, and that is the system working, not failing.
Quarterly: one look back. Compare two shipped decisions’ later numbers with the test’s prediction. It is the only way to learn how good your intervals are.
You have no experimentation platform and not enough traffic to detect small effects, and the table of sizes will say so. The honest design is often not an A/B test: a before-and-after comparison with a comparison group, a staged rollout, or five customer calls. If you do run a test, size it first and accept that only large effects are visible. The data scientist is also the platform: you assign buyers, write the query and read the result, so the discipline of writing the rule down first is the only control.
Ojaline’s growth team runs tests and the first tooling exists, but design review is optional and nobody owns the log. You become the person growth asks to read a result after the fact, which is the wrong end. The useful move is a short design template and a standing forty-five minutes a week. Expect to be argued with by people who ran tests for years without a power calculation and shipped some wins that were noise.
A central platform handles assignment, the sample ratio check and often sequential testing, and a review board or weekly forum reads results. Your work moves towards the design: metric definitions, power for the guardrails, variance reduction and the interpretation of results the platform flags. The politics are real. Senior owners have targets that depend on a result, and the readout is where independence matters. Keep the decision rule written in advance and signed by the owner.
Template
# Experiment readout: <name>
Owner of the decision · Analyst · Test dates · Date of this readout
## Decision and recommendation
Decision: <what is being decided, by whom, by when>
Recommendation: <ship / extend / stop / re-test, in one sentence, with the main reason>
## Design (written before launch)
Unit and population: <who is randomised; what the result can speak for>
Primary metric: <name, definition, source>
Guardrails and floors: <metric: the worst change we accept>
Exchange rate: <how much of the guardrail we give for how much of the primary>
Size: <buyers per arm; smallest effect seen with 80% power, for the primary and the main guardrail>
Decision rule: <what we do if the interval is clearly positive / includes zero / is clearly harmful>
## Health checks
Sample ratio: <counts and chi-square or p>. Exposure: <checked how>. Other: <A/A, logging>
## Result
| Metric | Control | Treatment | Difference | 95% interval | In owner's units |
|---|---|---|---|---|---|
Pattern over time: <by week; novelty or fade>
## What this test cannot say
<population limits; guardrail power; interference; anything that was not pre-agreed>
## Next measurement
<holdout, second test or review date; who reads it; stop rule> WORKED EXAMPLE
Ojaline, the Monday after Ayoola’s Friday post. Kweku writes the readout for the growth lead.
Decision and recommendation. Decision: whether to move more cities from ₦25,000 to ₦15,000 free delivery, for the growth lead, by next Friday. Recommendation: ship to the six cities, keeping a random 10% of buyers on ₦25,000, and read margin per buyer at four weeks. Reason: the change is reversible in a day, orders probably rise, and the Lagos test cannot read margin, which the holdout can.
Design. Unit: buyer; population: Lagos buyers, 41,060 in control and 40,940 in treatment, four weeks. Primary: orders per buyer. Guardrail: contribution margin per buyer, baseline about ₦3,250 per four weeks, floor −2%. Exchange rate: none was agreed before launch, so this one was set today with Marguerite in finance, before margin was cut by city, and is flagged as after the fact: up to 1% of margin per buyer for each 1% of orders. Power: 47% for a true +3.1%; smallest lift seen at 80% power, 4.6% for orders and 5.3% for margin.
Health. Sample ratio chi-square 0.18, p = 0.68. Banner exposure matches assignment.
Result. Orders per buyer 2.90 to 2.99, +3.1%, 95% interval −0.1% to +6.3%, p = 0.06. Margin per buyer ₦3,250 to ₦3,237, −0.4%, interval −4.1% to +3.3% (−₦133 to +₦107). Per 100,000 buyers in four weeks: about 9,000 more orders, margin between −₦13m and +₦11m. Weekly lift +4.4%, +3.6%, +2.8%, +1.6%, each too wide to read as a trend.
What this cannot say. Anything about margin smaller than about 5%; anything outside Lagos; whether the lift fades. Riders are shared, so control buyers may be slightly affected.
Next measurement. Rollout with a 10% holdout; read at four weeks; revert if the margin interval lies wholly below zero. The holdout can see about a 4.1% margin change.
Now you
The growth lead has agreed to ship to the six cities, Lagos included, on one condition: the holdout must be small. You are Kweku and must write the design half of the readout for the rollout, before launch. Inputs: about 380,000 active buyers across the six cities in a four-week window; baseline margin per buyer ₦3,250 with a standard deviation of about ₦8,800; you want to see a 5% change in margin per buyer with 80% power; the standard error of a difference between a treated and a held-out arm is the standard deviation times √(1 ÷ treated + 1 ÷ held out), and the smallest effect at 80% power is 2.8 times that. Growth will accept a holdout of 5%, 10% or 15%. Complications: week three is the festive peak, when baskets are larger than normal, and the held-out buyers pay ₦10,000 more to qualify for free delivery and may complain. Write the design, choose the holdout, state what the test can see, and write the decision rule.
Self-check
Friday, 16:00. Ojaline's Lagos threshold test is in: orders per buyer +3.1% (interval −0.1% to +6.3%, p = 0.06), margin per buyer −0.4% (interval −4.1% to +3.3%), healthy sample ratio, no pre-agreed decision rule. The growth lead wants to move the six cities, Lagos included, on Monday. You are Kweku and must recommend. A threshold is a configuration value and can be reverted in a day. What do you recommend?
- BOOK Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing Ron Kohavi, Diane Tang and Ya Xu, 2020
The standard reference from three people who ran experimentation platforms at Microsoft, Google and LinkedIn. Read the parts on choosing metrics and on checking that a result can be trusted before you design your next test. Read: Cambridge University Press; the chapters on metrics, trustworthiness and Twyman's law.
- PAPER The ASA's Statement on p-Values: Context, Process, and Purpose Ronald L. Wasserstein and Nicole A. Lazar, 2016
Six short principles on what a p-value does and does not tell you. Read it before you next say 'significant' in a readout, and use it when someone argues that 0.06 means the test failed. Read: The American Statistician 70(2), pages 129 to 133.
- PAPER Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data Alex Deng, Ya Xu, Ron Kohavi and Toby Walker, 2013
The paper behind CUPED, which uses each user's pre-experiment behaviour to cut the variance of a metric. Read it when your test is too small for the effect you care about and more traffic is not on offer. Read: WSDM 2013.
- POST How Not To Run an A/B Test Evan Miller, 2010
A short, clear explanation of why checking a test repeatedly and stopping at the first significant result inflates false positives. Ten minutes, and it settles the 'can we run it longer' argument with a reason.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.