The method of synthetic controls is a widely-adopted tool for evaluating causal effects of policy changes in settings with observational data. In many settings where it is applicable, researchers want to identify causal effects of policy changes on a treated unit at an aggregate level while having access to data at a finer granularity. This package implements a simple extension of the synthetic controls estimator, developed in Gunsilius (2023)

The DiSCos package contains tools for computing counterfactual quantile functions in a Distributional Synthetic Controls (DiSco) setting, following the method proposed in Gunsilius (2023).
Have a look at the vignette replicating the empirical application in the paper to get started.
To install the latest stable version, run
install.packages("DiSCos")
You can install latest development version from GitHub with:
devtools::install_github("Davidvandijcke/DiSCos")
If you find any bugs or have any questions, please email [email protected].
If you are using this package in your research, please cite:
Gunsilius, Florian F. 2023. “Distributional Synthetic Controls.” Econometrica 91 (3): 1105–17.
Van Dijcke, David, Florian Gunsilius, and Austin Wright. "Return to Office and the Tenure Distribution." arXiv preprint arXiv:2405.04352 (2024).
Q: Why does the code sometimes run slower than expected?
A: The approach in DiSCo is non-parametric and requires integrating over entire distributions, which naturally increases computational complexity. In particular, it can be costly for large datasets or large values of M and G.
Q: Is there a faster backend?
A: The optimization relies on libraries (e.g., “quadprog” or “CVXR”) that ultimately call C++ or FORTRAN under the hood. Even though these libraries are optimized, fully non-parametric distance-matching remains computationally heavy.
Q: How can I reduce the runtime while developing or debugging?
A:
M = 100 in DiSCo.G = 100, to reduce evaluation points.Ts = 2).CI=FALSE) and permutation tests (permutation=FALSE).num.cores in DiSCo, for example, by using a cluster or multiple cores to split bootstrap/permutation tasks.Q: Are there other suggestions for handling large real-world data?
A:
M, G, and the number of periods.grid.cat) if suitable for your data to reduce the dimension of the problem.Q: Can I get a progress bar?
A: When the package was first implemented, there were no functional solutions for progress bars with parallel computation in R. This may have changed—if you’d like to contribute, feel free to become that hero 🦸 and either enhance this repo or create your own parallel progress bar package!