help scul

Beta version 0.0.9 - Release date:June 31, 2022.
Update: August19,2022

Description

scul is adapted from the R code by Hollingsworth and Wing (2021) in the framework described by Abadie (2003,2010,2021) for comparative case studies. It uses LASSO to learn the treated
unit's pre-intervention outcomes via the donor pool's outcomes, and then projects the counterfactual.

Prerequisites

scul demands an xtset panel dataset before it can be used. Also, one needs the tabstatmat (ssc inst tabstatmat, replace), distinct (ssc inst distinct, replace), greshape (ssc inst gtools, replace), coefplot (ssc inst coefplot, replace), and cvlasso commands to use scul. Quintessential to estimation is the cvlasso commmand from the lassopack

Syntax

Note that by default, this command generates real vs. synthetic plots, as well as gap plots.

scul depvar, treated(variable) [ahead(number)] [placebos] [plat] [times(numlist)] [lambda(string)] [covs(varlist)] [cv(string)] [scheme(string)] [rellab(numlist)]
[obscol(string)] [cfcol(string)] [conf(string)] [legpos(integer)] [transform(string)] [q(real)] [donoradj(string)] [before(integer)] [after(integer)]

Requirements

depvar specifies the outcome. This variable may not have missing observations.

treated specifies the treatment variable. This variable may have no missing values, must be either 0 or 1, and must always be 1 after the treatment turns on. If more than one unit is treated, then scul uses staggered adoption.

Options

ahead specifies the number of periods ahead the user wishes to predict in the training dataset. See the options for cvlasso for details on this procedure.

lambda is optional. The user may specify lopt (optimal lambda) or lse (standard error rule), following the discussion from chapter two of Hastie et al. (2019).

placebos is optional. Iteratively, the treatment is reassigned to the entire donor pool of units, using the original model specified by the user. This produces a plot of these estimates, as well as 95% CIs of placebos.

plat is optional, and times is required. plat specifies the desire for in-time placebos. times reflects the relative event-time periods that the user wishes to use as a placebo period. If the
intervention happens in 2000 and the user specifies 5 and 10, the intervention will be evaluated at 1995 and 1990.

covs is optional. The counterfactual is estimated with these covariates.

scheme is optional. The user may specify the graph scheme they want here.

placebos is optional. The user estimates in-space placebos.

legpos is optional. The user specifies where they'd like their legend to appear on the graph in Stata's o'clock notation.

squerr is required, if placebos are specified. This option drops placebo units whose pre-intervention RMSPE is a given order of magnitude times greater than the RMSPE of the treated unit in the same period.

obscol and cfcol are optional. The user specifies the colors they'd like for their treated and untreated units lines to be.

q is optional. The user specifies the regularizer they'd like to use. When q=0, we have the Ridge penalty, and when q=1, we have the LASSO. By default, the LASSO is specified.

conf is optional. The user specifies "ci". The user graphs the confidence intervals from the t-test. Note that the confidence intervals are still calculated and present in the saved datasets, they just are not graphed if the user does not specify this option.

transform is optional. The outcome variable is normalized to the time before the intervention takes place at. See (Wiltshire, 2022) for details.

Required Options, Staggered Adoption

donoradj is required. The user specifies how they would like to adjust their donor pool by inputting et or nt as options. Specifying et means that the user wishes to use the units that were ever-treated as donors,
while nt means using only units which were never treated as donors.

before and after are required. The user specifies how many relative event-time periods the treatment effect will be averaged over. Note that this keeps only the treated units that have this many
before and after periods. Suppose a user has one year of monthly data on three treated units, one treated in January (period 1), another treated in March (period 3) and another treated unit in August (period 8). If the user specifies before(2) and after(2), then the first treated unit will be dropped because it doesn't have 2 periods of pre-intervention data.

Options, Staggered Adoption

rellab is optional. The user specifies how many periods the event-time axis will be labeled from and to. For example, if the user were to specify (-5(5)5), the graph will show the
average treatment effect from 5 periods before the intervention to 5 periods after the intervention. Note that this does NOT change the period over which the effects are calculated, only about how the treatment effect graph is displayed.

Results

Datasets

scul_unit Dataset for Single Treated Unit

timeplacebos In-Time Placebo Dataset

atts_scul Staggered Adoption Dataset

placebos_unit In-Space Placebo Dataset

Matrices

r(W) Weights Table for Single-Treated Case

r(ATTs) ATTs and Confidence Intervals for Staggered Adoption

r(itplacebos) ATTs and RMSEs for In-Time Placebo Studies

r(errs) ATT, Pre/Post RMSEs, Ratio and rank of In-Space Placebos

Scalars

e(ATT) Average Treatment Effect

e(MSE) Pre-Intervention Error

e(PMSE) Post-Intervention Error

e(LB) Lower Bound of ATT

e(UB) Upper Bound of ATT

e(ratio) Post error divided by pre-error

Examples

Note I use labvars and labmask

Single Treated Cases

Basque Country

u "http://fmwww.bc.edu/repec/bocode/s/scul_basque.dta", clear

qui xtset
local lbl: value label `r(panelvar)'

loc unit ="Basque Country (Pais Vasco)":`lbl'

loc int_time = 1975

qui xtset
cls

g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >= `int_time',1,0)

scul gdpcap, ahead(3) treat(treat) ///
obscol(black) cfcol("170 19 15") legpos(11)

Proposition 99- Divisional Analysis

loc int_time = 1989

u "http://fmwww.bc.edu/repec/bocode/s/scul_p99_region", clear
qui xtset
local lbl: value label `r(panelvar)'

loc unit ="California":`lbl'
qui xtset
g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >= `int_time',1,0)
cls

scul cigsale, ///
ahead(1) ///
treated(treat) ///
obscol(black) ///
cfcol(blue) ///
legpos(7) cv(adaptive)

BP Analysis

loc dv score

loc covs index_score buzz_score ///
impression_score ///
quality_score ///
value_score satisfaction_score ///
recommend_score

loc int_time: di tm(2010m4)

u "http://fmwww.bc.edu/repec/bocode/s/scul_bp.dta", clear

replace yougovname = subinstr(yougovname, ".", "",.)

labmask id, value(yougovname)
local lbl: value label id

loc unit ="BP":`lbl'
qui xtset
cls

g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >= `int_time',1,0)

format date %tm

lab var date "Month"

xtset id date, m // !! Makes our data panel data

keep if date <= tm(2012m6)

cls

scul score, ///
ahead(6) ///
treat(treat) ///
obscol(black) ///
cfcol(red) ///
legpos(5) ///
cv(adaptive)

West Germany

u "http://fmwww.bc.edu/repec/bocode/s/scul_Reunification.dta", clear
loc int_time = 1990
cls
qui xtset
local lbl: value label `r(panelvar)'

loc unit ="West Germany":`lbl'

g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >=`int_time',1,0)

// ssc inst labvars
labvars gdp treat "GDP per Capita" "Reunification"

scul gdp, ///
tr(treat) ///
ahead(8) ///
cfcol(red) obscol(black) cv(adaptive) ///
legpos(9) //

Kansas Tax Cuts

u "http://fmwww.bc.edu/repec/bocode/s/scul_Taxes", clear
loc int_time: disp tq(2012q1)
cls
qui xtset
local lbl: value label `r(panelvar)'

loc unit ="Kansas":`lbl'

g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >=`int_time',1,0)

scul gdp, ahead(4) treated(treat) ///
obscol(black) ///
cfcol(blue) ///
q(.5) cv(adaptive) legpos(7)

Ukraine Invasion Effect on GDP

u "http://fmwww.bc.edu/repec/bocode/s/scul_invasion.dta", clear
loc int_time = 2014
cls
qui xtset
local lbl: value label `r(panelvar)'

loc unit ="Ukraine":`lbl'

g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >=`int_time',1,0)

scul gdp, ahead(4) treated(treat) ///
obscol(black) ///
cfcol(blue) ///
q(.5) cv(adaptive) legpos(7)

Effect of Stadium on Housing Prices

u "http://fmwww.bc.edu/repec/bocode/s/scul_Stadium.dta", clear
loc int_time = 2017
cls
qui xtset
local lbl: value label `r(panelvar)'

loc unit ="Cobb":`lbl'

g treat = cond(`r(panelvar)'==`unit' & `r(timevar)' >=`int_time',1,0)

scul realgrossvpa, ahead(4) treated(treat) ///
obscol(black) ///
cfcol(blue) ///
q(.5) cv(adaptive) legpos(7)

Gas Holiday Studies

u "http://fmwww.bc.edu/repec/bocode/g/GasHoliday.dta", clear

xtset id date, d

scul regular, ///
ahead(28) ///
treat(treat) ///
obscol(black) ///
cfcol(170 19 15) ///
legpos(7) ///
before(28) after(28) ///
donadj(et) ///
rellab(-28(7)28) //

References

Abadie, A. (2021). Using synthetic controls: Feasibility, data requirements, and methodological aspects. J. Econ. Lit, 59(2), 391-425. https://doi.org/10.1257/jel.20191450

Abadie, A., Diamond, A., & Hainmueller, J. (2010). Synthetic control methods for comparative case studies: Estimating the effect of california’s tobacco control program. J. Am. Stat. Assoc.,
105(490), 493-505. https://doi.org/10.1198/jasa.2009.ap08746

Abadie, A., Diamond, A., & Hainmueller, J. (2015). Comparative politics and the synthetic control method. Am. J. Pol. Sci., 59(2), 495-510. https://doi.org/10.1111/ajps.12116

Abadie, A., & Jeremy, L. H. (2021). A penalized synthetic control estimator for disaggregated data. J. Am. Stat. Assoc., 116(536), 1817-1834. https://doi.org/10.1080/01621459.2021.1971535

Amjad, M., Shah, D., & Shen, D. (2018). Robust synthetic control. The Journal of Machine Learning Research, 19(1), 802-852. https://dl.acm.org/doi/10.5555/3291125.3291147

Botosaru, I., & Ferman, B. (2019). On the role of covariates in the synthetic control method. Economet J, 22(2), 117-130. https://doi.org/10.1093/ectj/utz001

Bouttell, J., Craig, P., Lewsey, J., Robinson, M., & Popham, F. (2018). Synthetic control methodology as a tool for evaluating population-level health interventions. J. Epidemiol. Community Health,
72(8), 673-678.https://doi.org/10.1136/jech-2017-210106

Bradbury, J. C. 2022. Does hosting a professional sports team benefit the local community? Evidence from property assessments. Economics of Governance 1–34. https://doi.org/10.1007/s10101-022-00268-z

Hastie, T., Tibshirani, R., & Wainwright, M. (2019). Statistical learning with sparsity: The lasso and generalizations. Chapman and Hall/CRC.

Hollingsworth, A., & Wing, C. (2022). Tactics for design and inference in synthetic control studies: An applied example using high-dimensional data [working paper] 10.31235/osf.io/fc9xt.

Li, K. T., & Bell, D. R. (2017). Estimation of average treatment effects with panel data: Asymptotic theory and implementation. J. Econom., 197(1), 65-75. https://doi.org/10.1016/j.jeconom.2016.01.011

Shi, Z., & Huang, J. (2021). Forward-selected panel data approach for program evaluation. J. Econom. https://doi.org/10.1016/j.jeconom.2021.04.009

Wiltshire, J. C. (2022). Allsynth: (stacked) synthetic control bias-correction utilities for stata [working paper]. https://tinyurl.com/2qmtqk9q

Contact

Jared Greathouse, Georgia State University -- https://tinyurl.com/2yjzfjz4
Emails--
Student: jgreathouse3@student.gsu.edu
Personal: j.greathouse200@gmail.com

Email me with questions, comments, suggestions or bug reports.