City launch without an A/B test: regression discontinuity
In a self-test, when I made drivers near a score cutoff cross it both ways, a regression discontinuity called a worthless offer worth keeping in 79.8% of runs.
Main limitation I wrote the generator, the reads, the checks and every failure, so each catch and each miss is a self-test: I made 20% of synthetic drivers near the line cross it each way in matched flows, which keeps the density flat by construction, so the density test fired in only 8.9% of those runs, and the smooth baseline is true by construction too. The effects, the break-even, the driver counts, the noise, how far drivers can move and how much motivation is worth are my choices, and every rate follows from them, so this shows how the design behaves, not how often drivers move in a real marketplace or what any real offer does.
A cutoff stands in for an A/B test only while nobody steers across the line for reasons tied to the outcome. Here a rule gives an offer to drivers with a service score of 70 or more, and I set everything else: 5,000 drivers in the base case, 1,000 runs per setting, a break-even of 3 extra trips a week. My recommendation: find out who can reach the line before reading the jump, run all three checks, and decide from the interval. In the setting above, the interval alone still settled the call wrongly in 20.8% of runs; with the checks quiet too, in 2.8%, but in 17.1% when motivation did not show in last quarter's trips (a score I added after the results).
| Clean line97.5%right calls on a worthless offer, because I drew the baseline smooth at the line and the offer's gain of 0 sits 3 trips below the break-even; 81.6% when the planted gain is 1.5 trips | Interval cannot tell58.3%of the same runs end with a 90% interval across the break-even; 11.0% with 20,000 drivers | One-way moving35.9%wrong calls on a worthless offer when 20% move up across the line; the density test fired in all 1,000, as it must when I pile movers above the line, but in 40.6% at a 5% share | Two-way, unflagged61.5%of runs read a worthless offer as worth keeping with no check firing, when motivation does not show in last quarter's trips (20.3% when it does). In a sweep of the share, motivation, band and drivers added after the results, the headline's wrong calls ran from 12.9% to 100% |
Runs out of 1,000 where the read called an offer worth nothing worth keeping, at 5,000 drivers. Each setting is one I built.
Wrong, and no check firedWrong, and a check fired
In plain words
Some offers go out by rule. A driver with a service score of 70 or more gets an offer next quarter; a driver at 69.9 does not. The question is whether to keep the offer: at the assumed cost it pays only if it adds more than 3 trips a week per driver. There is no A/B test, and comparing everyone above with everyone below is unfair, because higher scorers already drive more: here that raw gap reads +10.37 trips for an offer that does nothing.
A regression discontinuity compares only drivers near the line. If nothing else changes at the line, drivers just above and just below it are alike apart from the offer, so a jump in trips right at the line is the offer's effect. The read fits a line to each side and takes the gap where they meet the score of the rule.
The design rests on one thing it cannot prove: nobody steers across the line in a way that is tied to the outcome. The data stands in for a rule-based offer at a marketplace, and it is synthetic so that no customer data is shared. Because I planted the effect, every call can be scored.
- The line
- The score at which the rule changes: 70 here.
- Bandwidth
- How far from the line, in score points, a read looks. Narrow reads scatter; wide reads can take a curve for a jump.
- Plug-in rule
- A formula that picks the bandwidth from the run's own data, here of the Imbens and Kalyanaraman kind.
- Density test
- McCrary's test: does the number of drivers per score point jump at the line? A pile-up just above it suggests people moved.
- Balance check
- The same read on last quarter's trips, which the offer cannot have changed. A jump there means the two sides differ anyway.
- Placebo lines
- The same read at fake lines where nothing changes. A jump there means this read finds jumps that are not the offer.
- Donut
- Dropping the drivers closest to the line, in case they are the ones who moved.
- 90% interval
- A range that should hold the truth in 9 runs of 10. Here it comes from a curve on each side, to allow for the bias a straight line leaves.
- Break-even
- The effect at which the offer pays for itself: 3 extra trips a week under the assumed US$6 cost and US$2 a trip.
How often it made the right call
On the clean line the read averages +0.13 trips away from the truth, and its 90% interval held the truth in 907 of 1,000 runs. The point call is right most of the time far from the break-even and a coin flip at it, by construction. I predicted 85% to 97% at half and 1.5 times the break-even; half came in at 81.6%, the one miss of 16 predictions.
Share of 1,000 runs with the right point call, by planted effect and number of drivers, on the clean line (a 95% range for the 5,000-driver count); then, at 5,000 drivers, what the 90% interval settles.
| Planted effect, trips a week | Right call | 1,250 drivers | 5,000 drivers | 20,000 drivers | 5,000, noisier | Interval right, 5,000 | Interval wrong | Interval cannot tell |
|---|---|---|---|---|---|---|---|---|
| 0.0 | drop | 85.8% | 97.5% (96.3 to 98.3%) | 100.0% | 90.8% | 41.4% | 0.3% | 58.3% |
| 1.5 | drop | 70.6% | 81.6% (79.1 to 83.9%) | 97.7% | 74.7% | 15.2% | 0.9% | 83.9% |
| 3.0 | keep (either call costs nothing) | 48.3% | 52.7% (49.6 to 55.8%) | 51.1% | 51.3% | 5.1% | 4.2% | 90.7% |
| 4.5 | keep | 68.1% | 87.0% (84.8 to 88.9%) | 96.6% | 78.7% | 19.3% | 0.7% | 80.0% |
| 6.0 | keep | 83.4% | 98.0% (96.9 to 98.7%) | 100.0% | 93.0% | 43.2% | 0.2% | 56.6% |
The interval says what one run can claim: about 7.1 trips wide at 5,000 drivers against a 3-trip break-even, so it rarely settles the call. A line uses only the drivers near it: at 5,000 drivers this design is a small study even when the company is not.
What the bandwidth does
Narrow reads scatter: the spread falls from 2.93 trips at 2 points to 1.01 at 20. Wide reads take a curve for a jump: on the steep curve the 20-point read sits +2.75 trips high, and its interval held the truth in 143 of 1,000 runs. The plug-in rule chose 8.4 and 7.1 points on the two lines and stayed within 0.36 trips.
Each read at 1,000 runs of 5,000 drivers, with no planted effect; a 90% interval should hold the truth in about 900; here every row uses the plain interval, for a fair comparison.
| How far from the line the read looks | Spread of the read, trips | Clean line: average error | Interval held the truth | Right on an offer worth nothing | Steep curve: average error | Interval held the truth | Right on an offer worth nothing |
|---|---|---|---|---|---|---|---|
| 2 points | 2.93 | +0.13 | 895 | 83.6% | +0.13 | 895 | 83.5% |
| 5 points | 1.82 | +0.10 | 899 | 93.7% | +0.23 | 889 | 92.7% |
| Plug-in rule, 7 to 8 points | 1.51 | +0.13 | 906 | 97.5% | +0.36 | 873 | 96.0% |
| 10 points | 1.29 | +0.14 | 907 | 98.9% | +0.87 | 820 | 95.3% |
| 20 points | 1.01 | +0.36 | 880 | 99.7% | +2.75 | 143 | 60.4% |
| All drivers, one line a side | 0.89 | +0.80 | 744 | 99.7% | +5.52 | 0 | 0.3% |
| Raw gap, everyone above minus below | 0.54 | +10.37 | 0 | 0.0% | +20.61 | 0 | 0.0% |
On the clean line a wider read did better: 99.7% right at 20 points against 97.5% for the plug-in rule. So the rule gives up some power when the baseline happens to be gentle, which no team can know in advance. With the bias-corrected interval the rule's read held the truth in 907 and 897 of 1,000 runs on the two lines.
Tried after the results, the rule's working-paper constant and rdrobust's own rule barely moved the headline: the read kept a worthless offer in 1.9% and 4.5% of clean-line runs (2.5% with the plug-in rule) and in 77.1% and 82.0% with 20% moving each way (79.8%).
When it fails
Movers here are the more motivated drivers, so they carry extra trips over the line and leave fewer behind it. One way, the density test does its job from a 10% share: it fired in 95.5% of runs, and only 0.3% were wrong with no check firing. At a 5% share it fired in 40.6%, and at 10% with 1,250 drivers in 40.0%. Both ways, the flows nearly cancel in the count, so it fired in only 8.9% while the read stayed +4.25 trips high. The balance check fired in 68.6% of runs, because I made motivation show in last quarter's trips; without that it fired in 10.0%.
The primary read over 1,000 runs of 5,000 drivers in each setting; the settings share their draws, so they are not independent of each other.
| Setting | Drivers moved, average | Average read of an offer worth nothing | Wrong calls on it | Density test fired | Balance fired | Placebo lines fired | Wrong, no check fired |
|---|---|---|---|---|---|---|---|
| Clean line | 0 | +0.13 | 2.5% | 6.0% | 6.0% | 5.9% | 2.1% |
| Steep curve at the line | 0 | +0.36 | 4.0% | 6.0% | 5.4% | 5.7% | 3.7% |
| Second change at the same scores | 0 | +2.28 | 31.2% | 6.0% | 6.0% | 25.3% | 20.6% |
| 2% move across | 11 | +0.39 | 4.0% | 8.7% | 6.0% | 5.8% | 3.4% |
| 5% move across | 29 | +0.76 | 6.4% | 40.6% | 6.5% | 6.0% | 3.1% |
| 10% move across | 58 | +1.32 | 12.7% | 95.5% | 11.3% | 5.9% | 0.3% |
| 20% move across | 115 | +2.51 | 35.9% | 100.0% | 24.6% | 6.4% | 0.0% |
| 40% move across | 231 | +5.49 | 92.5% | 100.0% | 69.5% | 6.0% | 0.0% |
| 20% move, unrelated to motivation | 116 | −0.31 | 1.9% | 100.0% | 5.3% | 6.3% | 0.0% |
| 20% move each way | 218 | +4.25 | 79.8% | 8.9% | 68.6% | 5.5% | 20.3% |
| 20% each way, unseen last quarter | 218 | +4.25 | 79.8% | 8.9% | 10.0% | 5.5% | 61.5% |
Deciding from the interval avoids most of these wrong calls because it rarely settles anything: with 20% moving each way it could not tell in 78.3% of runs, and when it settled it was nearly always wrong (20.8% wrong against 0.9% right). The last two columns, added after the results, score the rule this page recommends: the interval with all three checks quiet.
What the 90% interval settles on an offer worth nothing, over 1,000 runs of 5,000 drivers; the last two columns count only runs where no check fired, the rule this page recommends, scored after the results.
| Setting | Interval settled it rightly | Interval settled it wrongly | Interval cannot tell | Checks quiet, settled rightly | Checks quiet, settled wrongly |
|---|---|---|---|---|---|
| Clean line | 41.4% | 0.3% | 58.3% | 34.4% | 0.3% |
| Second change at the same scores | 3.1% | 7.0% | 89.9% | 2.2% | 5.2% |
| 5% move across | 25.6% | 0.2% | 74.2% | 13.9% | 0.0% |
| 20% move across | 5.5% | 3.8% | 90.7% | 0.0% | 0.0% |
| 20% move each way | 0.9% | 20.8% | 78.3% | 0.3% | 2.8% |
| 20% each way, unseen last quarter | 0.9% | 20.8% | 78.3% | 0.6% | 17.1% |
A firing check is a reason to look, not a verdict. When drivers moved for reasons unrelated to motivation, the density test fired in all 1,000 runs while the read averaged −0.31 trips and was right on the worthless offer in 98.1%. And on the clean line at least one of the three checks fired in 17.3% of runs, so holding on any firing also holds good reads.
Placebo lines did not see moving or the curve: at 5,000 drivers they fired in 5.3% to 7.1% of runs, near their 5% false-alarm bar, and at 1,250 drivers in 8.0% and 7.4%, because nothing jumps at a fake line. They caught the fake steps in 25.3% of runs, and I placed those lines on the steps.
A donut helps only if it is wide enough, and I know how wide because I set the band. Dropping 1 point removes every mover, since they land within 1 point, but leaves the band they left short of motivated drivers: the error stays +1.69 trips. Dropping 3 points removes that band too: the error falls to +0.29, but the spread grows from 1.52 to 3.77 and it was right on the worthless offer in 80.1%.
A right read at the line can still mislead a decision about anyone else. With an effect of 6 trips at the line, growing with the score by my choice, the read landed at +6.17 and said keep in 97.9% of runs. Drivers below the line would average 2.57 trips under the same choice, below the break-even, so extending the offer to them would lose money.
The same columns for one-way moving when an input I chose moves: the number of drivers and how much motivation is worth; the clean line at other driver counts and noise is in the right-call table above.
| Setting | Drivers moved, average | Average read of an offer worth nothing | Wrong calls on it | Density test fired | Balance fired | Placebo lines fired | Wrong, no check fired |
|---|---|---|---|---|---|---|---|
| 10% move, 1,250 drivers | 14 | +1.09 | 25.2% | 40.0% | 5.1% | 7.4% | 12.0% |
| 10% move, 20,000 drivers | 230 | +1.21 | 1.7% | 100.0% | 27.9% | 6.0% | 0.0% |
| 20% move, motivation worth 4 trips | 115 | +1.09 | 7.5% | 100.0% | 9.3% | 7.1% | 0.0% |
| 20% move, motivation worth 12 trips | 115 | +3.98 | 69.0% | 100.0% | 46.5% | 5.4% | 0.0% |
Is the 79.8% the design's or my inputs'? A sweep added after the results moves one input at a time, 1,000 runs each. Wrong calls ran from 12.9% at a 5% share each way to 100% at 40%, and from 15.6% to 98.3% as motivation went from 4 to 12 trips. The interval with the checks quiet settled wrongly in at most 5.4% of runs while motivation showed in last quarter's trips, and in up to 53.2% when it did not. In every row with motivation hidden but the 6-point band, most wrong calls went unflagged, and the density test never fired in more than 35.9%.
Added after the results: 1,000 runs per setting, one input moved at a time from the two-way setting above; each setting shares its draws with the earlier settings of its size.
| Setting | Drivers moved | Wrong calls | Density fired | Wrong, no check fired | Same, motivation unseen | Interval and checks: wrong | Same, motivation unseen |
|---|---|---|---|---|---|---|---|
| 5% each way | 55 | 12.9% | 5.3% | 9.6% | 10.8% | 0.6% | 0.9% |
| 10% each way | 110 | 32.7% | 6.3% | 19.2% | 26.5% | 1.6% | 2.9% |
| 20% each way, as above | 218 | 79.8% | 8.9% | 20.3% | 61.5% | 2.8% | 17.1% |
| 40% each way | 437 | 100.0% | 20.6% | 1.9% | 56.7% | 1.6% | 40.6% |
| 20%, motivation worth 4 trips | 218 | 15.6% | 8.9% | 11.5% | 12.7% | 0.2% | 0.3% |
| 20%, motivation worth 12 trips | 218 | 98.3% | 8.9% | 5.0% | 76.4% | 2.2% | 53.2% |
| 20%, 1,250 drivers | 54 | 61.1% | 6.5% | 41.0% | 48.2% | 4.7% | 6.0% |
| 20%, 20,000 drivers | 872 | 92.5% | 22.2% | 0.3% | 50.5% | 0.0% | 22.6% |
| 20%, a band of 1.5 points | 110 | 54.6% | 4.5% | 21.1% | 46.6% | 5.4% | 14.4% |
| 20%, a band of 6 points | 421 | 67.9% | 35.9% | 15.5% | 20.6% | 3.0% | 3.8% |
Two runs, worked through
Two runs chosen by a rule in the design. On the clean line, with 6 trips planted, the plug-in rule chose 8.4 points and the read was +6.62. It says keep, which is right; its 90% interval, 2.61 to 9.22, says this one run cannot be sure. No check fired.
With 20% of near-miss drivers moving (110 here) and nothing planted, the read was +3.34, above the break-even, so the point call keeps a worthless offer. Its interval, −0.95 to 6.06, could not tell. The pile-up above the line is visible in the bars, the density test fired (z of 7.7), and balance and placebo lines did not.
Trips a week by service score, one point at a time; bars below are drivers per point. The dashed line is the score of 70.
What a team should do with this
- Find out who can reach the line first. Product and operations state how the score is made, whether drivers see it, whether they can time, appeal or nudge it, and whether the offer has a catch that makes some prefer to stay below. If people can choose their side, the design's assumption is in doubt whichever check passes. It is the only defence when last quarter's trips cannot show why people moved: there the steps below settled wrongly in 17.1% of runs.
- Write the read down before looking at outcomes. The data scientist fixes the line, the outcome, the break-even, the bandwidth rule and what each check firing will mean. Finance supplies the cost.
- Draw it, then run all three checks. Plot trips and drivers per score point. A firing check sends the team to look at who moved. A quiet density test can miss a small one-way share and says little about two-way moving, so never let it stand alone.
- Decide from the interval, and size for it. A point call near the break-even is a coin flip. If the interval spans the break-even, say the run cannot tell. More drivers near the line is what narrows it. On the clean line, the interval with the checks quiet settled the call rightly in 34.4% of runs and wrongly in 0.3%; the rest made no call.
- Keep the claim at the line. The read speaks for drivers near the line. Before moving the line or extending the offer, test the new group, for example by randomizing inside a band around the line (advice beyond these results: no run here did that).
- Use a maintained package for real work. My fits matched rdrobust at the same bandwidth, but for a decision rdrobust and rddensity carry options this page leaves out, such as a coarse score or partial take-up.
From the assumed terms, not from data: 34.5% of 5,000 drivers sit at or above the line, about 1,723. Keeping an offer worth nothing costs about US$10,300 a week, about US$124,000 over its 12 weeks. Dropping an offer worth twice the break-even gives up the same amount, if its effect were the same for everyone above the line.
Limits
- The settings fixed before the runs move several of my inputs, and a sweep added after the results moves the two-way share, motivation, band and drivers one at a time. The 1-point landing zone, the shape of the baseline and the way motivation sets who moves stay fixed.
- A sharp rule: everyone above takes the offer and nobody below does. Partial take-up, a coarse score with few values, spillovers between drivers and effects that fade are left out.
- Calls at different planted effects reuse the same runs, and settings of one size share draws, so the rows are not independent of each other.
Use this at your company
To read a rule of your own the same way, paste this into an AI assistant along with your data.
This method comes from Diogo Travassos's study "City launch without an A/B test: regression discontinuity at a score cutoff" (https://diogotravassos.dev/city-launch-without-ab-test/regression-discontinuity.html). If you can open links, read it first: it works the method through end to end, with its checks. The steps below stand on their own if you can't. Help me estimate the effect of an offer given by a rule: everyone at or above a score gets it, nobody below does, with no A/B test. Data I will give you: one row per person with the score, the outcome after the rule applied, the same outcome from before it applied, whether the person got the offer, and the break-even effect. Before any estimate, ask me how the score is made, whether people can see it, whether they can act to change their side of the line in either direction, and whether anything else changes at the same score. Method: 1. Plot the average outcome and the number of people per score bin around the line. 2. Fit a line on each side with triangular weights at a data-driven bandwidth (rdrobust or similar), and read the jump at the line. 3. Give a bias-corrected 90% interval. 4. Repeat at half and at double the bandwidth, and report how the read moves. Checks before trusting the result: - Density test at the line (rddensity or McCrary's test). A quiet test does not rule out people moving in both directions. - The same read on the outcome from before the rule applied. It should show no jump. - The same read at fake lines, each using only people on its own side of the real line. Use a bar corrected for the number of lines. - If a check fires, say which one and what it could mean, and make no call until we have looked. A firing check is a reason to look, and does not by itself mean the read is wrong. Report back: the plot, the read and its interval against the break-even, the checks, whether the interval settles the call or cannot tell, and a plain statement that the read speaks for people near the line, not for everyone. In your report, say which study you followed and link it: https://diogotravassos.dev/city-launch-without-ab-test/regression-discontinuity.html
Method and checks
Design and predictionsDesign added after the resultsProtocolResultsResults added afterEvery runHow to run it
Set in advance
The design, the protocol, the 16 predictions and the code were committed before any reported run. The planning table in the design is numerical integration over the generator and reads no simulated outcome, and I used it to set how strong the curve and the steps are, so that those settings could bite. 15 of the 16 predictions held; the design file lists them all. The miss: I predicted the point call right in 85% to 97% of runs at half and 1.5 times the break-even, and half came in at 81.6%.
The simulated drivers
5,000 drivers in the base case. The service score is normal with mean 66 and standard deviation 10, clipped to 0 to 100, and the offer goes to scores of 70 or more, with no exceptions. Weekly trips without the offer are 60 + 0.5 x + 2 tanh(x / 10) + 8 M + 16 e, where x is the unmoved score minus 70, and motivation M and noise e are standard normals unrelated to the score; last quarter's trips share the curve and motivation, with their own noise. A driver within 3 points below the line moves with a chance of the share times 2 Phi(M), so movers are the more motivated, and lands within 1 point above it; two-way, drivers within 3 points above drop below with a chance of the share times 2 Phi(minus M). A move changes the score, never the trips. The steep curve, the steps and every other setting are in the design file.
The reads, the checks and the calls
The primary read fits a line to each side with triangular weights at a plug-in bandwidth of the Imbens and Kalyanaraman kind. Its 90% interval comes from a curve of order 2 on each side at the same bandwidth, with that fit's own standard error, the bias-corrected interval of Calonico, Cattaneo and Titiunik. Fixed half-widths use the plain interval. The density test is McCrary's and fires at a z above 1.96. Balance is the bias-corrected read on last quarter's trips at its own bandwidth, firing at a z above 1.96. Placebo lines are the bias-corrected read at ten fake lines, 57.5 to 67.5 and 72.5 to 82.5 every 2.5 points, at the read's bandwidth, each seeing only drivers on its own side of the real line, firing when any z passes 2.807. The point call keeps the offer when the read is above 3 trips (the design and results files call this extending it). The interval call pays when the whole interval is above 3, does not pay when it is all below, and otherwise cannot tell. Because a constant effect only shifts the read, each run is stored once and scored at each planted effect, which a test proves on real draws. The 95% ranges are Wilson intervals over 1,000 runs.
Checks on the code
Lines through noiseless data return the planted jump exactly. A planted pile-up fires the density test and a known density ratio comes back. A jump at a fake line fires the placebo lines, while a jump of 30 trips at the real line leaves them unchanged. The average reads at fixed half-widths match the planning arithmetic, a second route to the same numbers. Against rdrobust on 50 runs each of two settings, at the same bandwidth, the reads and standard errors match to six decimal places. The plug-in rule is a different rule from that package's own: its bandwidth was a median 1.14 and 1.06 times the package's, ranging from 0.69 to 4.07 times. It also hardly narrowed with more drivers (averages 8.6, 8.4 and 8.2 points at 1,250, 5,000 and 20,000), which the next section explains. The package rddensity runs a different density test, and on 100 runs each the two fired about as often: 6 and 5 on the clean line, 31 and 30 at a 5% share, 100 and 100 at 20%, 11 and 14 two-way. They fired on the same run only 1, 17, 100 and 1 times. So on those 100 runs the package's test also fired rarely under two-way moving, and the two seldom flagged the same runs. The right-call rates on a clean line check only arithmetic and power, because the baseline is smooth there by construction.
Added after the results
Decided after the first results had been read, declared in a second design file with its own predictions, and committed before its code and its runs. The files fixed before the first runs are unchanged. All 17 predictions held, but they come from arithmetic on the same generator, so they guard the code more than they test the design. The two-way sweep draws from the same seed, so each setting is paired with the earlier settings of its size.
The plug-in rule's constants, against two working-paper versions of the Imbens and Kalyanaraman paper, the rdd R package and the older version of this rule kept inside rdrobust: 1.84, 3.56 and 3.4375 match all four. The term that holds the curvature estimate in check is 2160 in my code and in that rdrobust version, and 720 in the working papers and rdd; I could not read the journal version. The bandwidth stays flat with more drivers because this baseline has no curvature gap at the line, so what the rule reads as curvature is noise that shrinks as drivers grow: from 1,250 to 20,000 drivers that term fell 16.4 times over the first 100 runs while the rule's second bandwidth stayed between 10.6 and 12.3 points, which offsets the rule's own shrinking factor.
Reproduce it
Every run replays from its seed with no network.
python3 -m cutoff.run run SETTING # each of the 19 named in protocol-regression-discontinuity.json python3 -m cutoff.run summarise python3 -m cutoff.run check # replays all 19,000 rows python3 -m cutoff.addendum run SETTING # the 18 added settings; then bandwidth SETTING, summarise and check python3 -m pytest tests/test_cutoff.py tests/test_cutoff_methods.py tests/test_cutoff_addendum.py tests/test_cutoff_page.py python3 site/render_cutoff.py python3 -m cutoff.crosscheck # needs requirements-crosscheck.txt