1/36
Part 1 of 6 · No coin flipLearn

Difference-in-differences, when you can't run an A/B test

One OpenAI senior data scientist report lists an experimentation question about what you'd do if you cannot run an A/B test (1 report). Netflix tests nearly all proposed product changes with controlled A/B experiments (1 source), and for the questions those can't answer, it says "we rely on quasi-experiments and causal inference methods to inform decisions" (1 source). An Airbnb staff analytics posting asks for causal methods when randomized trials aren't available (1 source), Anthropic's growth data scientist posting lists quasi-experiments next to A/B tests (1 source), and a prep site lists an Airbnb screen question about a feature "launched globally on 2025-05-10 with no control or holdout" (1 source). Our version of the practice reads like this:

A new policy reached 15 of 30 cities in week 8, and the other 15 never got it. You have every city's metric for 16 weeks. Estimate what the policy did, and tell me whether to trust the estimate.

The practice comes in four levels. Level 1 writes did_estimate, from four means. Level 2 writes pre_trend_gap, which checks parallel trends on the weeks before launch. Level 3 writes placebo_estimate, a fake launch date that should find nothing. Level 4 writes event_study, the gap week by week.

You don't write them yet. The lesson starts with why the easy comparisons are wrong, builds the estimate on a worked example, then tests its one assumption, and ends with the regression, clustered standard errors and staggered rollouts. At the end you solve the whole problem, level by level, in an interview simulation with a 40-minute timer.

This lesson builds on the A/B test lesson, which had a coin flip to lean on, and on the cluster-randomized lesson's clustered standard errors. It's the last lesson on experiments.