Data science · Experiments — the checks before the result

Causal inference when you cannot run a test

Sometimes randomising is impossible — the feature shipped everywhere, the policy is legally required, the change is a price. This lesson works difference-in-differences by hand, shows the pre-trend check that decides whether the estimate means anything, and lays out matching, synthetic control, instrumental variables, and regression discontinuity with the assumption each one buys.

26 min read Full lesson in the app Patterns: difference-in-differences, parallel-trends, synthetic-control, regression-discontinuity

What you'll be able to do

Before this: peeking-novelty-and-interference

Log in to read the rest of this lesson

Sometimes randomising is impossible — the feature shipped everywhere, the policy is legally required, the change is a price. This lesson works difference-in-differences by hand, shows the pre-trend check that decides whether the estimate means anything, and lays out matching, synthetic control, instrumental variables, and regression discontinuity with the assumption each one buys. This walkthrough runs about 26 minutes, with runnable code you can edit and re-run as you read. A new account gets 7 days of Pro free, no card required.

Log in to continue

The first module of every track is free to read on the web: see what's open in Data science.