* Clean environment
*clear all
*macro drop _all
set more off
* Install packages
*ssc install distinct, replace all
*ssc install elasticregress, replace all
*ssc install blindschemes, replace all
*net install tsg_schemes, from("https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/") replace
*ssc install synth, replace all
*net install synth_runner, from("https://raw.github.com/bquistorff/synth_runner/master/") replace all
*net install allsynth, from("https://justinwiltshire.com/s") replace all
* Program parameters
*set graphics `= cond("`c(mode)'"=="batch", "off", "on")'
version 12
set scheme gg_tableau
use "https://github.com/quarcs-lab/data-open/raw/master/synth/synth_smoking.dta", clear
describe
summarize
tsset state year
synth_runner cigsale beer(1984(1)1988) lnincome(1972(1)1988) retprice age15to24 cigsale(1988) cigsale(1980) cigsale(1975), trunit(3) trperiod(1989) gen_vars
ereturn list
display (e(pval_joint_post_std)*e(n_pl)+1)/(e(n_pl)+1)
single_treatment_graphs
effect_graphs
pval_graphs