Dear All,
I am trying to estimate synthetic control difference-in-difference case studies using the synth package introduced in
Abadie, A., Diamond, A., and J. Hainmueller. 2010. Synthetic Control Methods for Comparative Case Studies: Estimating the Effect of California's Tobacco Control Program. Journal of the American Statistical Association 105(490): 493-505. (http://fmwww.bc.edu/RePEc/bocode/s/synth.html).
I have state-quarter data from 34 states. 15 states implement a policy change, but at different times and 19 states serve as the donor pool to create the synthetic controls. As is standard, the outcome variable in the quarters prior to the treatment perioid are included as explanatory variables in the synth estimation. Since, each of the 15 states implements the policy change in different periods the number of lagged outcome variables to be included as explanatory variables differs in each case study.
I have written the following to do the 15 different case-studies...but I don't know how to incorporate the appropriate lagged outcome variables as controls:
Stata gives me the error: (1(1)(5-1)) does not exist as a (numeric) variable in dataset r(198); I think I am not including the lags correctly. I will appreciate any help I can get please. Sincerely, Sumedha.
I am trying to estimate synthetic control difference-in-difference case studies using the synth package introduced in
Abadie, A., Diamond, A., and J. Hainmueller. 2010. Synthetic Control Methods for Comparative Case Studies: Estimating the Effect of California's Tobacco Control Program. Journal of the American Statistical Association 105(490): 493-505. (http://fmwww.bc.edu/RePEc/bocode/s/synth.html).
I have state-quarter data from 34 states. 15 states implement a policy change, but at different times and 19 states serve as the donor pool to create the synthetic controls. As is standard, the outcome variable in the quarters prior to the treatment perioid are included as explanatory variables in the synth estimation. Since, each of the 15 states implements the policy change in different periods the number of lagged outcome variables to be included as explanatory variables differs in each case study.
I have written the following to do the 15 different case-studies...but I don't know how to incorporate the appropriate lagged outcome variables as controls:
local outcome narc
local controlvars age015 age1624 age2534 age3544 age4554 age5564 age65plus agemiss male pop
tsset trunit qtr
forvalues lname = 1/15 {
preserve
local t=`lname'
display `t'
keep if (trunit==`lname'|trunit>15)
egen maxp_`lname'=max(qtrtreat)
local p=maxp_`lname'
display `p'
qui synth `outcome' `controlvars' `outcome'(1(1)(`p'-1)) , trunit(`t') trperiod(`p') fig keep(synthetic-casestudy`lname', replace)
restore
}
local controlvars age015 age1624 age2534 age3544 age4554 age5564 age65plus agemiss male pop
tsset trunit qtr
forvalues lname = 1/15 {
preserve
local t=`lname'
display `t'
keep if (trunit==`lname'|trunit>15)
egen maxp_`lname'=max(qtrtreat)
local p=maxp_`lname'
display `p'
qui synth `outcome' `controlvars' `outcome'(1(1)(`p'-1)) , trunit(`t') trperiod(`p') fig keep(synthetic-casestudy`lname', replace)
restore
}
Comment