Causal inference when you cannot run an experiment
Build the stand-in for what would have happened, state the assumption it rests on, test the parts that can be tested, and report a range that is honest about the parts that cannot
In the three four-week periods after the rollout, margin per buyer averaged ₦46 higher than before in the six cities that moved to ₦15,000, and ₦60 higher in the three that stayed on ₦25,000. What does that comparison estimate?
The experiment chapter ended on a piece of advice: when a change is cheap to reverse, ship it with a randomly chosen holdout, because a rollout with a holdout is an experiment. Growth did not. The analysis memo named the consequence, that the three held cities were chosen for thin rider supply and not at random, and left open what you can still say. This chapter is that answer. It applies to every case of the same shape: a policy changed for some places, customers or days and not others, by someone who was not running a test. Metrics and experiments owns experiments as product practice, and the experiment chapter owns design and readout. This one is for when randomisation is missing and a decision still has to be made.
The model: you need a stand-in for what did not happen
An experiment answers a causal question because randomisation makes the control group a fair picture of what the treated group would have done without the change. Take the randomisation away and the question is the same: what would margin per buyer have been in these six cities if the threshold had stayed at ₦25,000? Nobody saw that. Every method in this chapter is a way of building a stand-in for it, and every stand-in rests on an assumption you have to argue for. A causal estimate without its assumption is a number with a hidden condition.
| Stand-in | What it assumes | At Ojaline |
|---|---|---|
| Before and after | Nothing else changed at the date | The season, rain and fuel prices all changed in the quarter; the six cities’ margin rose, and so did everyone’s |
| Treated against untreated, after | The groups were alike to begin with | The held cities have the thinnest rider supply, so they were not alike |
| Difference-in-differences | Without the change, both groups would have moved the same amount | The method of this chapter; the held cities supply the movement |
| Synthetic control, matching | A weighted blend of untreated places tracks the treated place | Needs many untreated places; Ojaline has three |
| Regression discontinuity, instrumental variables | A cut-off or a nudge that behaves like a coin toss | No cut-off exists; the Lagos test was the one coin toss, and it was one city |
Scott Cunningham’s Causal Inference: The Mixtape teaches each of these.
The philosophy is the one the memo chapter set: argue for the comparison before you look at the estimate. The classic public example is David Card and Alan Krueger’s 1994 study of fast-food restaurants. New Jersey raised its minimum wage and eastern Pennsylvania did not, so they compared employment before and after in the two places. The finding was contested, and a later re-evaluation using payroll records reached a different answer. The method did not settle the matter; it made the disagreement specific enough to have.
Difference-in-differences, by hand
The set-up is Ojaline’s nine cities. Take three four-week periods before the rollout and three after. Lagos’s test weeks are removed from its before periods, because in them half its buyers were already on ₦15,000. The outcome is margin per buyer in naira per four weeks, because that is what the Lagos test could not read. The estimate is two subtractions:
effect = (treated after − treated before) − (held after − held before)
All figures are illustrative, built around the track’s facts: about ₦3,250 margin per buyer, about 380,000 buyers per four weeks in the six treated cities, and about 90,000 in the three held. The table shows each city’s average over the before periods, how fast it was rising before, and its change.
| City | Group | Buyers (000) | Before (₦) | Trend (₦ per period) | Change (₦) | Change less held (₦) |
|---|---|---|---|---|---|---|
| Lagos | Treated | 140 | 3,250 | 20 | +44 | −16 |
| B | Treated | 70 | 3,340 | 21 | +34 | −26 |
| C | Treated | 55 | 3,180 | 19 | +46 | −14 |
| D | Treated | 35 | 3,290 | 22 | +30 | −30 |
| F | Treated | 30 | 3,400 | 20 | +42 | −18 |
| E | Treated | 50 | 3,120 | 52 | +80 | +20 |
| G | Held | 40 | 3,230 | 21 | +64 | +4 |
| H | Held | 30 | 3,150 | 18 | +60 | 0 |
| I | Held | 20 | 3,260 | 20 | +52 | −8 |
Weight each city by its buyers, because the question is about buyers’ margin. The held cities rose ₦60 on average. The five treated cities other than E rose ₦40.6, so the estimate for them is −₦19.5 per buyer per four weeks, or about −0.6% of the margin they would otherwise have had. Add E, which rose ₦80, and the six cities together rose ₦45.7, so the pooled estimate is −₦14.3, about −0.4%. That is Moyosore’s number. Look at what it replaced: the six cities’ own before-and-after reads as growth of ₦46, and it is growth that the held cities, which rose by more, show would have happened anyway.
There is a free check. Lagos is in the table and in the test. The test put margin per buyer at −0.4%, about −₦13. The table gives Lagos −₦16, or −0.5%. The two agree, though the test’s own interval, about −₦133 to +₦107, is wide enough that agreement is weak evidence. Whenever an experiment and a comparison of this kind cover the same ground, line them up. It is the cheapest way to learn whether your design behaves.
The assumption you cannot test: parallel trends
The estimate is right only if the six cities would have gained ₦60 per buyer without the change, as the held cities did. This is the parallel-trends assumption. It is about something that did not happen, so no test can confirm it. What you can do is ask what it implies about the past, and look.
The table’s trend column does that. Before the rollout the five treated cities were rising by ₦20.3 per period and the held cities by ₦19.8. They were moving together. City E was rising by ₦52, more than twice as fast, and it is 13% of the treated buyers. If E would have kept climbing at that rate for three more periods, its expected change was about ₦156, and its actual ₦80 is a large loss. If its trend would have matched the others, it is a gain of ₦20. The data do not say which.
Two cautions keep this check honest. First, three before periods give a slope from two gaps, which has little power to detect a modest difference. Jonathan Roth and co-authors, in a survey of the recent literature, point out that a design can pass a pre-trend test and still be wrong, and that selecting your analysis because it passed adds a bias of its own. A failed check is informative and a passed one is not proof. Second, the more important doubts do not appear in any column. Ask the people who know how the comparison group was chosen. Valeria’s answer is that the three cities were held for thin rider supply. Cities like that may respond differently to a shared shock, such as a festive demand peak or a fuel price rise, even if they moved together before it. Pre-trends cannot see a difference that has not yet happened.
Four more questions belong on the design page.
- Anticipation. Did buyers or growth change behaviour before the date, so that the before period is already affected?
- Spillovers. Could the held cities have been touched, through shared sellers, shared marketing or fleet moves? On-time delivery fell from 92% to 89% in the six cities and stayed at 92% in the three. That fall is part of how a lower threshold costs money, so it belongs inside the effect. Do not adjust for it as if it were a confounder.
- Composition. Free delivery may bring in new, smaller buyers. Margin per buyer then averages over a different mix. Decide whether you mean buyers who were present before or everyone, and say which.
- Other changes. Did anything else happen to one group at the date? A new hub, a sellers’ promotion, a fee change.
There is a better question than “parallel or not”. Asher Rambachan and Roth suggest asking how far the trends could diverge after the date, measured against the largest gap you saw before it, and showing how the estimate moves as that allowance grows. It converts an argument about one assumption into a statement about how much you would need to be wrong.
Nine cities, not 470,000 buyers
The table has 470,000 buyers a period and nine cities. The cities are the units. The change was made to a city, and the buyers inside a city share the rain, the traffic and the riders, so their margins move together. Treat the buyers as independent and every interval comes out too narrow. Marianne Bertrand, Esther Duflo and Sendhil Mullainathan showed that conventional standard errors in comparisons of this kind were far too small when the outcomes in a group are correlated over time, and that analysing at the level of the group, or using a randomisation-style test, repairs it.
With nine cities, the randomisation-style test is cheap to do by hand. There are 84 ways to choose which six of nine cities count as treated. Compute the gap in changes for each, using the real data. The real split’s gap is −₦14.3. Twelve of the 84 splits, 14%, give a gap that low or lower, and 18 of 84, about one in five, give a gap at least that far from zero in either direction. Take away the four lowest and four highest and the other 76 sit between −₦21 and +₦16. In words: differences between cities this size are ordinary. The data cannot separate −₦14 from zero.
Not one of the 84 splits reaches −₦29. The floor that Tigist and finance agreed in the memo chapter is a fall of 2% in margin per buyer, which is ₦65 per buyer, or ₦24.7m per four weeks across the six cities. City-to-city variation does not come near it. The doubt is large relative to the estimate and small relative to the decision. That is the combination to look for. The caveat is the one the earlier chapters kept: the held cities were not drawn at random, so this describes the scale of luck and not a p-value to quote.
City E: three ways to handle it
E gives the analysis a fork. Each branch is defensible, and the estimates differ.
| Version | Treatment of E | Estimate (₦ per buyer per four weeks) | % of margin | Six cities, per year |
|---|---|---|---|---|
| A | Drop E, use five treated cities | −19.5 | −0.6% | about −₦96m if applied to six |
| B | Keep E, assume parallel trends for all | −14.3 | −0.4% | about −₦70m |
| C | Keep E, let it follow its own trend | −26.9 | −0.8% | about −₦133m |
Across 380,000 buyers, B is −₦5.4m and C −₦10.2m per four weeks; a year is 13 periods. Version A drops 13% of the treated buyers and is a choice made after seeing that E looks odd. Make a rule before looking, such as “exclude any city whose before-trend differs from the group’s by more than ₦15 per period”, and the exclusion is a design. Make it after seeing the answer and it is a fork in the garden that the analysis memo warned about. Version B assumes the thing the data argue against. Version C assumes a steep trend continues, which fails if E’s rise was catch-up that was about to flatten. So no version wins, and the useful report is the three together: between −₦14 and −₦27 per buyer per four weeks, about −0.4% to −0.8% of margin, with a reason for each. The reasons, together with the nine-city luck band, are the doubt the board needs.
When to say “it cannot be known”
Sometimes it is the honest answer, and you should know when. It is true when assumptions you cannot choose between give estimates on both sides of the decision line, so that the choice of assumption is the choice of decision. It is also true when there is no comparison group at all, as when every city moved on the same day. Then you are back to before and after, and to a forecast of what the trend would have done, which is the territory of the track’s chapter on forecasting.
It is not true here, though some careful analysts would say so. The effect itself cannot be pinned down: it may be nothing, and it may be as large as −₦27. But the question Tigist has to decide on is whether the loss is large enough to revert, and every version sits well short of the −₦65 floor. So the sentence is: “The threshold probably cost between nothing and about ₦27 per buyer per four weeks, about 0.8% at most. None of the three versions comes near the 2% floor.” That is a claim you can make from this data, with its limits stated.
The limits matter too. Margin per buyer says nothing about the 6% fall in gross merchandise value in Q3, which the chief executive’s question began with; the same design on that outcome would be a separate analysis with its own caveats. It says nothing about what a lower threshold did for the roughly 48,000 sellers. And it does not say whether the effect is fading or will hold. The next measurement is the one that changes the answer: when the three held cities move to ₦15,000, stagger them in a random order, four weeks apart, so the first read is an experiment.
Where practitioners disagree
Design or model. Economists in the line of Joshua Angrist and Jörn-Steffen Pischke put weight on a credible comparison and on being plain about it. Others hold that a clever comparison is no substitute for a model of how buyers and cities behave, because a design can be clean and answer a narrow question. In a company, the practical position is to take the design as far as it goes and say where it stops.
Pre-tests. Some teams drop any design that fails a pre-trend test. The Roth line is that the test is weak and that selecting on it distorts what remains, so show the sensitivity instead.
Difference-in-differences or synthetic control. Synthetic control builds a weighted blend of untreated places to match the treated one. It suits few treated units and many untreated ones. With three held cities there is little to blend, and the weights will fit noise.
Claim or association. A cautious school says “associated with” and leaves it. The cost is the balanced shrug from the memo chapter: the owner gets the numbers without the meaning. The compromise is to give the causal estimate, name its conditions in the first paragraph, and say which parts are fact and which are judgement.
Where it goes wrong
Picking the version after seeing the answer. With three versions, one looks best for somebody. Write the rule for each version first, and report all of them.
Controlling for a consequence of the treatment. On-time delivery fell because of the change. Adjusting for it removes part of the real effect and reports the remainder as the whole.
The interval at buyer level. It makes the doubt look small. The cities are the units.
Calling a held group untouched. If growth, marketing or the fleet team changed anything in those cities during the quarter, the comparison carries it. Ask.
Reading before and after as cause. The 6% fall in gross merchandise value and the six-city rollout share a quarter. That is all they share, on this evidence.
One number with no assumptions. “The threshold cost 0.4%” is Moyosore’s version B, true under a condition. Stated without it, the first challenge from finance undoes the rest of the memo.
Day to day
Before touching the data: the design page. Write down the treated and comparison groups, how the comparison group was chosen, the outcome, the periods and the rule for excluding a place. Spend thirty minutes with whoever knows why the groups differ. For the threshold that is Valeria. Do it before any estimate exists.
Plot first. Draw each city’s outcome by period on one chart. A day of work, and the picture will show you city E before the table does.
Build the table, the hand estimate and the versions. One analyst computes it and a second recomputes from the raw rows. Moyosore does the second pass, and the two numbers must match to the naira before anything is written.
Write the memo with the range first, using finance’s own margin definition and the template in the artefact.
At launch, not afterwards. In the growth planning meeting, the question to put every time is: what is our comparison group for this change? It costs a minute when a change is planned and weeks when it is not. If the answer is “none”, the next move is the holdout from the experiment chapter, and this chapter is the fallback.
Keep a log. Record each estimate with its versions, and compare it with the next experiment’s answer.
There is no data team and the change was made to whoever the founder chose, so the comparison group is whoever was left. You will not have nine cities, perhaps two. Write the assumption in one sentence and give the range. With two units, say plainly that luck dominates. The cheapest improvement is a decision, not a method: make the next rollout staggered, with the order drawn by lot, so that you are never again asking this question afterwards.
Growth rolls changes out by city and the data team is asked afterwards. Expect to be the person who tells the growth lead that the held cities were not a fair comparison, and expect pushback because the number was already in a deck. A one-page design template and a rule that multi-city changes name their comparison group at launch are worth more than any method. Ojaline is here: nine cities, one test, and a rollout nobody planned to read.
Causal claims go into steering groups and regulatory or board papers, and an econometrics group or an external reviewer may check your design. Your work moves to the standard: a template, a register of quasi-experiments with their assumptions, and sensitivity bounds as the default. Expect the estimate to be challenged by someone with a stake in it, so keep the design page dated and signed before the numbers exist. Scale gives you many units, and the problem becomes correlated outcomes and many versions to choose from.
Template
# Causal analysis: <effect of X on Y, as a question>
To · From · Date · Decision it informs
## Answer
<A range in the reader's unit and as a percentage, how sure you are, and the one assumption it rests on.>
## Design
Treated: <who, how many, when> · Comparison: <who, how many, how chosen>
Outcome: <metric, definition, source> · Periods: <before, after, anything excluded and why>
Rule for excluding a unit: <written before looking>
## Data and the hand estimate
| Unit | Group | Size | Before | Trend before | Change | Change less comparison |
|---|---|---|---|---|---|---|
Estimate = (treated change) − (comparison change) = <working>
## Assumptions and checks
Parallel trends: <what the before-trends show; which unit departs>
Anticipation · Spillovers · Composition · Other changes at the date: <one line each>
## Versions
| Version | What it assumes | Estimate | % of margin | Stake per year |
|---|---|---|---|---|
## What chance covers, and what it does not
<Luck at the level of the units; design doubt that no interval covers.>
## What this cannot say
<Other outcomes, other groups, whether the effect lasts.>
## What would change this, and the next measurement
<Result, date, who looks; a holdout or random order for the next change.> WORKED EXAMPLE
Ojaline, the week after the board pack draft. Kweku writes the analysis for Tigist; Moyosore recomputed it from the raw rows and Valeria confirmed how the held cities were chosen.
Answer. Moving six cities to ₦15,000 probably cost between ₦14 and ₦27 of margin per buyer per four weeks, 0.4% to 0.8%, about ₦70m to ₦133m a year across about 380,000 buyers per four weeks. The data cannot separate that from zero. No version comes near the 2% floor of ₦65 per buyer.
Design. Treated: six cities, 380,000 buyers per four weeks. Comparison: three cities, about 90,000, held for thin rider supply, so not random. Outcome: contribution margin per buyer, finance’s definition. Periods: three four-week periods before and three after; Lagos’s test weeks removed.
Hand estimate. Held cities +₦60. Five treated cities (E excluded) +₦40.6, giving −₦19.5. All six +₦45.7, giving −₦14.3. Lagos alone −₦16, against −₦13 in its test.
Checks. Before-trends: five treated cities ₦20.3 per period, held ₦19.8, city E ₦52. E is 13% of treated buyers. Delivery on time fell from 92% to 89% in the six; that is inside the effect.
Versions. A drop E: −₦19.5 (−0.6%). B all six, parallel: −₦14.3 (−0.4%). C E on its own trend: −₦26.9 (−0.8%). Rule for A was agreed before the table was built.
Chance. Nine cities. Of 84 ways to pick six, 18 give a gap as far from zero as −₦14.3, and 76 lie between −₦21 and +₦16. None reaches −₦29.
Cannot say. Anything about the 6% gross merchandise value fall, sellers, or whether the effect fades.
Next. Move the three held cities in a random order, four weeks apart, and read at twelve weeks.
Now you
Tigist has taken the margin range and asks the other half: did the six-city rollout raise orders per buyer? The Lagos test said +3.1%, with an interval of −0.1% to +6.3%. You are Kweku. Moyosore has pulled the nine-city table below for orders per buyer per four weeks, using the same three periods before and three after and the same buyer counts. Valeria points out that G, one of the held cities, was already rising faster (this is orders, not margin, so a different city stands out from the margin table’s E) than any other city before the rollout. Work out the estimate with all three held cities and with G removed, and say what each means in extra orders per four weeks across the six cities. Compare both with the Lagos test. Then state the doubt that is left: with G removed, only two held cities and 50,000 buyers remain. Write the analysis in the template.
City Group Buyers(000) Before Trend/period Change
Lagos Treated 140 2.90 0.020 +0.152
B Treated 70 3.05 0.020 +0.141
C Treated 55 2.70 0.019 +0.150
D Treated 35 2.85 0.021 +0.139
E Treated 50 2.60 0.021 +0.158
F Treated 30 3.20 0.020 +0.148
G Held 40 2.75 0.055 +0.150
H Held 30 2.55 0.019 +0.058
I Held 20 2.80 0.021 +0.062Self-check
It is Friday, and the board pack closes at five. Tigist wants one sentence from you, Kweku, on what the six-city rollout did to margin per buyer. The three held cities were not chosen at random, and city E, 13% of the treated buyers, was rising twice as fast as the others before the change. Moyosore's pooled estimate is −₦14 per buyer per four weeks; without E it is −₦19; letting E follow its own trend it is −₦27. The agreed floor for reverting is −₦65. What do you put in the pack?
- BOOK Causal Inference: The Mixtape Scott Cunningham, 2021
A free online edition that teaches difference-in-differences, synthetic control and the other designs named here, with code. Read it for the checklist of assumptions to state before you report an estimate. Read: Chapters 9 and 10 of the online edition: difference-in-differences, and complex designs.
- BOOK Mostly Harmless Econometrics: An Empiricist's Companion Joshua D. Angrist and Jörn-Steffen Pischke, 2009
The standard account of the design-first view of causal work: find a credible comparison and be plain about what it assumes. It is also the best place to see how standard errors should be handled when the units are few. Read: Chapter 5, on fixed effects, differences-in-differences and panel data.
- PAPER How Much Should We Trust Differences-in-Differences Estimates? Marianne Bertrand, Esther Duflo and Sendhil Mullainathan, 2004
Shows with placebo policies that conventional standard errors in these comparisons can be badly too small. Read it before you quote an interval from buyer-level data when the change was made to cities. Read: Quarterly Journal of Economics 119(1), pages 249 to 275; the abstract and the placebo-law results.
- PAPER Minimum Wages and Employment: A Case Study of the Fast-Food Industry in New Jersey and Pennsylvania David Card and Alan B. Krueger, 1994
The best-known published comparison of one place that changed a policy against one that did not. Read it to see how an argument about the comparison group becomes the argument about the result. Read: American Economic Review 84(4), pages 772 to 793.
- PAPER A More Credible Approach to Parallel Trends Ashesh Rambachan and Jonathan Roth, 2023
Proposes reporting how an estimate changes as you allow the trends to diverge by more or less, in place of a yes or no on parallel trends. Use it when you have to say how wrong the assumption could be before the answer changes. Read: Review of Economic Studies 90(5), pages 2555 to 2591; the introduction.
- PAPER What's Trending in Difference-in-Differences? A Synthesis of the Recent Econometrics Literature Jonathan Roth, Pedro H. C. Sant'Anna, Alyssa Bilinski and John Poe, 2023
A survey of what the recent literature says about checking the assumption, including why passing a pre-trend test is weak comfort. Read it before you tell anyone that the trends were parallel. Read: The sections on parallel trends and pre-testing.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.