Skip to content
Tutorials Center
My learning

Topics

Lesson 28 of 37 ยท Instrumental Variables and DiD

Synthetic Control

Learn the synthetic control method: build a weighted blend of donor units that mimics one treated unit, estimate the effect after an intervention and test it with placebo runs.

What happened to one country after a new law, to one state after a tax change, or to sales in one city after a store campaign? With a single treated unit, ordinary difference-in-differences is shaky: which one control city is "the" comparison? Picking by hand invites bias.

The synthetic control method builds the comparison from data. It takes a pool of untreated donor units and finds a weighted average of them whose pre-treatment path matches the treated unit as closely as possible. After the intervention, the gap between the treated unit and its synthetic twin is the estimated effect.

The recipe

  1. Collect outcomes for the treated unit and J donors over many pre-intervention periods.
  2. Find non-negative weights that sum to one so the weighted donor average tracks the treated unit before the intervention.
  3. Apply the same weights after the intervention to get the counterfactual path.
  4. Effect at time t = actual minus synthetic.

Weights that are non-negative and sum to one mean the synthetic unit is an interpolation, not an extrapolation: it stays within the range of the donors, and you can read exactly which donors it is made of.

Python Building a synthetic control with constrained weights

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The pre-period RMSE should be small, which tells you the synthetic unit tracks the real one. The post-period gap averages close to 4. The weights are sparse: only a few donors matter.

Inference by placebo

With one treated unit, there is no sampling distribution to lean on. The standard approach is a permutation (placebo) test: pretend each donor had been treated, build a synthetic control for it, and compute its post-period gap. If the real unit's gap is extreme compared with the placebo gaps, the effect is unlikely to be chance.

Compare gaps relative to pre-period fit: a donor with a poor pre-fit will have large post gaps for uninteresting reasons. The usual statistic is the ratio of post-period RMSE to pre-period RMSE.

Python Placebo test: is the effect unusual?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The treated unit has the largest ratio of all, so the permutation p-value is the smallest possible, 1/21 (about 0.05). With 20 donors you cannot get a smaller p-value than that, a built-in limit of the placebo approach.

Choosing donors and checking the fit

  • Donor pool. Exclude units also hit by the intervention or by a major shock, and units that are very different in structure. A bad pool cannot be rescued by clever weights.
  • Pre-period length. More pre-periods make it harder to fit by luck. Too few and the match is meaningless.
  • Fit quality. If even the best weighted average cannot track the treated unit before the intervention, synthetic control is the wrong tool; the treated unit lies outside the convex hull of the donors.
  • Predictors. Applied studies often also match on covariates, weighting predictors by importance. Our demo matches only on outcomes.
  • Leave-one-out. Re-estimate dropping each heavily weighted donor to see whether one donor drives the result.

Newer variants relax the rules: augmented synthetic control corrects residual imbalance with a regression, and synthetic difference-in-differences blends the two ideas and allows several treated units.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What constraints are put on synthetic control weights?

    These constraints make the synthetic unit a weighted average of donors, so it interpolates instead of extrapolating.
  2. 2. How is the effect estimated after the intervention?

    The synthetic unit is the counterfactual; the gap to it is the effect.
  3. 3. Why use placebo tests?

    Applying the method to untreated donors shows how large gaps are by chance.
  4. 4. The best weighted average still fits the treated unit badly before the intervention. What should you conclude?

    Without a good pre-period fit there is no reason to trust the counterfactual.

Summary

  • Synthetic control builds a counterfactual for one treated unit as a weighted blend of untreated donors.
  • Weights are non-negative and sum to one, chosen to match the pre-intervention path.
  • Placebo (permutation) tests give inference; compare post/pre fit ratios.
  • A poor pre-period fit, a bad donor pool or too few pre-periods undermine credibility.
  • Augmented and synthetic DiD methods extend the idea.

Next: Heterogeneous Treatment Effects