gsynth implements the generalized synthetic control method, which imputes counterfactuals for each treated unit using control group information based on a linear interactive fixed effects model. This version supports unbalanced panels and implements the matrix completion method.
Authors: Yiqing Xu (Stanford), Licheng Liu (MIT)
Date: Feb 22, 2022
Repos: Github (1.2.1) CRAN (1.2.1)
Example: R code used in the tutorial can be downloaded from here.
You can install gsynth directly from CRAN by typing the following command in the R console:
install.packages('gsynth', type = 'source')
You can also install the development version of the package from Github by typing:
install.packages('devtools', repos = 'http://cran.us.r-project.org') # if not already installed
devtools::install_github('xuyiqing/gsynth')
gsynth depends on the following packages, which will be installed automatically when gsynth is being installed; you can also install them manually:
## for processing C++ code
require(Rcpp)
## for plotting
require(ggplot2)
require(GGally)
## for parallel computing
require(foreach)
require(future)
require(doParallel)
require(abind)
require(lfe)
Please report bugs to yiqingxu [at] stanford.edu with your sample code, data file, and a treatment status plot generated by panelview. Much appreciated!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.