A Companion Paper for Synthetic Controls
As I mentioned in a previous post, I’m reading Matheus Facure’s Causal Inference in Python in a reading group. We’re in the middle of the synthetic control (SC) chapter, and I noticed one of the cited papers provides a very good reading companion.
The paper is Alberto Abadie’s “Using Synthetic Controls: Feasibility, Data Requirements, and Methodological Aspects” (available here). In this post I’ll walk through some ways in which the paper reinforces, extends, and in one case corrects, the coverage of the book chapter.
Linear factor model#
A good place to start is the linear factor model. The book’s model, from the boxed section “Synthetic Control Assumptions”, is
The paper instead uses a more complicated model (),
with
The superscript designates the outcome without intervention. The paper uses for the treated unit, and for the control units. Hence the synthetic control is trying to recreate .
We’ll be using the paper’s version in this blog post.
By the way, if you have the book and its equation looks something like
that’s a byte encoding/decoding issue, and the correct version is what I put at the top of this section.
Simulated data#
We’ll use data simulations based on the paper’s linear factor model. For simplicity we’ll use a single treated unit.
Each simulated dataset has 20 control units and one treated unit. Each unit has two observed predictors, , and two unobserved, . The treated unit’s predictors are chosen to be a convex weighted average of three control units, chosen at random. The true treatment effect is at every post-treatment period.
We’ll use two basic scenarios:
| scenario | pre-periods | noise | signal-to-noise |
|---|---|---|---|
| short-noisy | 15 | 1.2 | ~ 1 |
| long-clean | 60 | 0.4 | ~ 3 |
There is one further segmentation of scenarios used for bias analyses. The treated unit can be inside the convex hull (as described so far) or moved along a specific direction to be outside the convex hull. The meaning of “convex hull” is demonstrated in the next section’s illustration. The within-hull version is used except where explicitly stated otherwise.
In all cases, 200 datasets are drawn per scenario.
Why weights are often sparse#
The book points out sparsity is a consequence of the SC’s convex weights, but doesn’t explain further. If you’re used to working with convex combinations, then the reason for the sparsity might have been clear. If not, hopefully the illustration below helps.
The set of all possible convex-weighted combinations, i.e., the set of all possible SCs, forms a solid, as pictured below. This is called the convex hull.
By the design of the simulation, the initial treated point is a convex combination of a few of the control units, highlighted when . However, this () convex combination is not necessarily unique. Whenever a treated unit is inside the convex hull, the best set of weights is not necessarily unique or sparse. Outside the hull, there will always be a subset of points that create a best approximation, and that subset will be a single vertex of the hull, two points along an edge of the hull, or the points on a single face of the hull.
Use of covariates#
The book primarily matches on the outcome alone. It spends relatively little time on using covariates. For the paper, it’s the reverse: covariates are central and the outcome-only matching is treated as a sub-case. It sees outcomes-only matching as a “technical or expositional convenience” that “may create the mistaken impression that other predictors play a minor role”.
The paper mentions a few ways to determine the covariates’ weights (). We’ll use the version where covariate weights are optimized iteratively along with the units’ weights. This is similar to the book, which also uses co-optimization of covariate and unit weights, but the details are different.
We’ll see below that the book’s method does not perform well in the simulations. Since the book’s method is both non-standard and performs poorly, I’d treat the paper’s method as a correction of it.
The paper’s method is below, using the book’s notation. Hopefully writing it this way will make it easier to substitute into the book’s workflow. You can safely skip ahead to the Comparisons section below if you’d like.
-
Data prep:
- Data shape: Each predictor should be one scalar per unit so the original covariate matrices are replaced by a single predictor-by-unit matrix. A single covariate can contribute multiple predictors (even one per pre-treatment period), though. In array terminology, the constraint here is on one dimension of the
shape, not the other dimension and not thesize. The ‘s below are assumed to be correctly shaped. - Data content: If using both covariates and pre-treatment outcomes as predictors, you can’t use all pre-treatment outcomes. If you do, the covariates end up with zero weight, so you’re effectively not using covariates (Kaul et al. 2022).
- Data shape: Each predictor should be one scalar per unit so the original covariate matrices are replaced by a single predictor-by-unit matrix. A single covariate can contribute multiple predictors (even one per pre-treatment period), though. In array terminology, the constraint here is on one dimension of the
-
Inner loop: the values are determined by minimizing the distance between weighted covariates :
where the subscript indicates the th predictor.
-
Outer loop: the optimization should use the outcomes alone:
where is used to emphasize that the values depend on the values .
-
The synthetic control is then constructed from just the outcomes and values:
( and are not used in this step).
Comparisons#
Three versions of synthetic control, plus a reference, were used for both of the simulation scenarios. The (estimated average treatment effect on the treated) was calculated for each simulation and method. The plots show the error .
The paper warns (§6) that with few pre-treatment periods, “close or even perfect fit of the predictor values for the treated unit may be spuriously attained,” which makes the short-noisy scenario the one where covariates should help. The long-clean scenario is where Botosaru & Ferman (2019) argue matching on outcomes alone is admissible. Both of those are borne out by the simulations.
The “Best possible SC weights” are the convex weights that would best recreate a noise-free version of the target counterfactual (which we only know because we control the simulation).
A few highlights from the plots:
- The book’s covariate method performs poorly in both situations, but especially poorly when the pre-treatment period is short and noisy.
- The paper’s covariate method is best or tied for best in both situations.
- Outcome-only performs well when the pre-treatment period is long and has relatively low noise.
The outcome was included in both covariate methods. For the paper’s version, five block-average outcome values were used, rather than the individual per-period outcomes (blocks have size 3 in the “short” data and 12 in the “long”). Step 1.b. above explains why.
Bias#
The book talks about SC bias in multiple places. The two most important points it makes (IMO) are (1) you can expect SC to be biased in practice, and (2) overfitting is one of the principal causes.
The paper gives a more detailed description of bias for the linear factor model (3.3, “Bias Bound”). Recall the paper uses a linear factor model where is a vector of observed predictors, is a vector of unobserved predictors, and is used for the treated unit.
Essentially, the goal of SC (when we assume the linear factor model) is to combine the control units’ predictors to approximate the observed predictors . If SC could perfectly match both and , then the SC-provided would be unbiased for the true . Unfortunately, is unobserved, which means it can only be matched indirectly, if at all. Thus the SC estimate can be biased, especially when the pre-treatment period is short or noisy.
Further, if the treated unit lies outside the convex hull of the control units, then there will be a portion of the treated unit that a convex combination of the control units won’t be able to match. The figure below demonstrates this. Within the hull, the outcomes-only SC is approximately unbiased in these simulations. Outside the hull, not only is outcomes-only SC biased, but the best possible SC weights are also biased.
For the simulations outside the hull, the treated unit is moved along a single predictor, which has a positive coefficient on average. This ensures that the bias will tend to point the same way instead of averaging out. As mentioned earlier, the “Best possible SC weights” are the convex weights that would best recreate a noise-free version of the target counterfactual.
The paper gives further details about bias bounds and factors that contribute to overfitting.
Bias correction#
The book addresses bias with a method that creates multiple SC fits, each leaving a block of pre-treatment times out of the fit. The left-out block then provides both true and estimated treated values, which can be used to estimate bias for that fit. The final SC fit and ATT estimate comes from the mean of those fits, each corrected with its own bias estimate. As the paper points out, this method specifically corrects estimation bias that is stable across time periods.
In 8, “Bias correction”, the paper presents an additional regression-based method from Abadie & L’Hour (2019). We use two versions: (1) where the regression predictors are just covariates, and (2) where the regression predictors are covariates and pre-treatment outcome averages.
All three methods are applied as corrections to SCs fitted using outcomes only, i.e., without covariates. The plot below compares the bias correction methods when the treated unit is inside and outside the control units’ convex hull.
Inside the hull, no correction is needed; applying bias correction is mostly safe, except the second regression method increases RMSE. Outside the hull, the book’s method and the second regression method both do well at reducing the bias, but the second regression method has lower RMSE. The first regression method works well if the treated unit is outside of the hull along an observed predictor (), but not along an unobserved predictor ().
Below is the same plot, but for the scenario with the short, noisy pre-treatment period. The horizontal scale is different from the plot above, but comparisons can be made through the RMSE.
Almost all of the conclusions for the previous plot carry over, with a couple important differences:
- As above, no correction is needed inside the hull, but the adjustments also do not introduce any (significant) bias.
- The paper’s second regression method works well across all three subplots. In each case, it is the best or nearly the best in terms of both bias and RMSE (apart from the oracle weights).
- The book’s method has the highest RMSE.
Inference#
In the last section I mentioned that the book used leave-one-time-block-out as a way to correct for bias. The book then also used those estimates to get a confidence interval on the ATT. The method it uses follows Chernozhukov et al. (2019b).
The paper devotes two subsections to inference, 3.5 and the un-numbered “Inference” subsection of 8. Section 3.5 focuses on creating a p-value from a permutation test. Section 8 discusses methods proposed by other researchers, including both Chernozhukov et al. papers that the book points to for inference.
I will apply the permutation test from 3.5, because it provides a good foundation in two ways. It is probably the prototypical method for inference in synthetic controls, and it is a good introduction to a wider group of permutation-based methods. See the paper for details.
Both the book method and permutation method were applied to each of the 200 simulated datasets, for each scenario.
The plot above compares the p-value distributions to the expected uniform distribution. The dashed diagonal line indicates perfect agreement. Overall, the book method seems to do well, except in the top middle sub-plot. The paper method approaches the edge of the band in the same sub-plot, and dips outside of the band in the lower left sub-plot, but otherwise performs well.
The plot above shows how often each method detects the effect. They’re roughly tied for the short, noisy scenario, but the permutation test has a strong advantage for the long, clean scenario.
Robustness and diagnostics#
The book spends little to no time on checking the robustness of the model. While the paper doesn’t explore the topic extensively, it does devote a short section to it (7) and presents two techniques: backdating for testing sensitivity to the treatment initiation date, and leave-one-donor-out for testing sensitivity to the donor pool.
The illustration below demonstrates backdating.
Instead of using all of the pre-treatment period for fitting, you artificially limit the fitting periods. Any large changes in either the or the remaining pre-treatment fit could indicate issues with the fit. This example is very stable across backdating choices, which is a good sign.
The leave-one-donor-out sensitivity check does what it sounds like. The control units with nonzero weight in the fitted SC (“donors”) are dropped one at a time. The SC fit is redone with each drop, and its predictions are compared to the original. Over-reliance on any single donor could signal an issue.
Conclusion#
The book chapter is a great hands-on introduction to synthetic controls, and, as this post shows, Abadie (2021) can be paired with it for a more thorough grounding. There is only one book issue above that needs to be corrected: the procedure for choosing covariate weights, when covariates are used. (To be clear, one correct method is presented above; the paper mentions others.)
Other sections contain information that, though less urgent, is still worth knowing. For example:
- why convex weights lead to sparsity
- covariates do indeed improve estimation in some situations (in the book’s example they did not)
- where SC bias comes from
- bias correction methods that can perform better than the book’s (though only demonstrated with one set of simulations)
- permutation-based inference performed at least as well as the book’s method in these simulations
- two robustness and diagnostic techniques
References#
Abadie, Alberto. 2021. “Using Synthetic Controls: Feasibility, Data Requirements, and Methodological Aspects.” Journal of Economic Literature 59 (2): 391–425. https://doi.org/10.1257/jel.20191450
Abadie, Alberto, and Jérémy L’Hour. 2019. “A Penalized Synthetic Control Estimator for Disaggregated Data.” Working paper. https://sites.google.com/site/jeremylhour/research
Botosaru, Irene, and Bruno Ferman. 2019. “On the Role of Covariates in the Synthetic Control Method.” The Econometrics Journal 22 (2): 117–130. https://doi.org/10.1093/ectj/utz001
Chernozhukov, Victor, Kaspar Wüthrich, and Yinchu Zhu. 2019a. “An Exact and Robust Conformal Inference Method for Counterfactual and Synthetic Controls.” arXiv:1712.09089. https://arxiv.org/abs/1712.09089
Chernozhukov, Victor, Kaspar Wüthrich, and Yinchu Zhu. 2019b. “Practical and Robust t-Test Based Inference for Synthetic Control and Related Methods.” arXiv:1812.10820. https://arxiv.org/abs/1812.10820
Facure, Matheus. 2023. Causal Inference in Python: Applying Causal Inference in the Tech Industry. Sebastopol, CA: O’Reilly Media.
Kaul, Ashok, Stefan Klößner, Gregor Pfeifer, and Manuel Schieler. 2022. “Standard Synthetic Control Methods: The Case of Using All Preintervention Outcomes Together with Covariates.” Journal of Business & Economic Statistics 40 (3): 1362–1376. https://doi.org/10.1080/07350015.2021.1930012
Comments
Commenting anonymously? Usernames must have at least 3 characters (letters, numbers, spaces).