/*********************************************************************************** *********************************************************************************** Replication of empirical results in Chapter 12: Structural Change as Temporal Heterogeneity of Eric Neumayer and Thomas Plümper: Robustness Tests for Quantitative Research, Cambridge University Press 2017 *********************************************************************************** ***********************************************************************************/ * Stata version 12 or higher needed version 12 *********************************************************************************** *********************************************************************************** * change relative path to the directory where the data are located local DIR = "C:\Users\Eric\Documents\Book\Robustness\" cd "`DIR'" *********************************************************************************** *********************************************************************************** * Install user-written ado-files capture net install outreg2, from(http://fmwww.bc.edu/RePEc/bocode/o) *********************************************************************************** *********************************************************************************** *** Trended Effect Test use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline replace year=year-1959 replace gdppc_const= gdppc_const/1000 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust outreg2 using table, replace excel margins, dydx(gdppc_const) at(year=(1(1)52)) saving(margins_base, replace) * Robustness test model tab year, gen(year_dum) reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const c.gdppc_const#c.year year_dum* , robust outreg2 using table, append excel margins, dydx(gdppc_const) at(year=(1(1)52)) saving(margins_rob, replace) combomarginsplot margins_base margins_rob, labels("Baseline" "Robustness test") title("") ytitle("") xtitle("Year count") graphregion(color(white)) bgcolor(white) graph save "C:\Users\Eric\Documents\Book\Robustness\Trended effect test", replace graph export "C:\Users\Eric\Documents\Book\Robustness\Trended effect test.eps", as(eps) replace *********************************************************************************** *********************************************************************************** *** Chow Test of Temporal Heterogeneity use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace year=year-1959 replace gdppc_const= gdppc_const/1000 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust outreg2 using table, replace excel ** with 1991-1996 post-Soviet dummy * Robustness test model use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace gdppc_const= gdppc_const/1000 capture dropvars soviet_post shock_period gen shock_period=(year>=1991 & year<1997 ) gen soviet_post=(soviet_core+soviet_non_core)*shock_period replace year=year-1959 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust outreg2 using table, append excel * Estimating degrees of effect robustness quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust scalar coeff_b=_b[gdppc_const] scalar se_b=_se[gdppc_const] scalar lb_b= coeff_b -invnormal(1-(100-c(level))/200)*se_b scalar ub_b= coeff_b +invnormal(1-(100-c(level))/200)*se_b quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust scalar coeff_r=_b[0.soviet_post#c.gdppc_const] scalar se_r=_se[0.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in other country years is: " robustness scalar coeff_r=_b[1.soviet_post#c.gdppc_const] scalar se_r=_se[1.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in post-Soviet period years is: " robustness ** with 1991-1999 post-Soviet dummy * Robustness test model use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace gdppc_const= gdppc_const/1000 capture dropvars soviet_post shock_period gen shock_period=(year>=1991 & year<2000 ) gen soviet_post=(soviet_core+soviet_non_core)*shock_period replace year=year-1959 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust outreg2 using table, append excel * Estimating degrees of effect robustness quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust scalar coeff_b=_b[gdppc_const] scalar se_b=_se[gdppc_const] scalar lb_b= coeff_b -invnormal(1-(100-c(level))/200)*se_b scalar ub_b= coeff_b +invnormal(1-(100-c(level))/200)*se_b quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust scalar coeff_r=_b[0.soviet_post#c.gdppc_const] scalar se_r=_se[0.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in other country years is: " robustness scalar coeff_r=_b[1.soviet_post#c.gdppc_const] scalar se_r=_se[1.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in post-Soviet period years is: " robustness ** with 1991-2002 post-Soviet dummy * Robustness test model use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace gdppc_const= gdppc_const/1000 capture dropvars soviet_post shock_period gen shock_period=(year>=1991 & year<2003 ) gen soviet_post=(soviet_core+soviet_non_core)*shock_period replace year=year-1959 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust outreg2 using table, append excel * Estimating degrees of effect robustness quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust scalar coeff_b=_b[gdppc_const] scalar se_b=_se[gdppc_const] scalar lb_b= coeff_b -invnormal(1-(100-c(level))/200)*se_b scalar ub_b= coeff_b +invnormal(1-(100-c(level))/200)*se_b quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust scalar coeff_r=_b[0.soviet_post#c.gdppc_const] scalar se_r=_se[0.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in other country years is: " robustness scalar coeff_r=_b[1.soviet_post#c.gdppc_const] scalar se_r=_se[1.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in post-Soviet period years is: " robustness ** with 1991-2005 post-Soviet dummy * Robustness test model use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace gdppc_const= gdppc_const/1000 capture dropvars soviet_post shock_period gen shock_period=(year>=1991 & year<2006 ) gen soviet_post=(soviet_core+soviet_non_core)*shock_period replace year=year-1959 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust outreg2 using table, append excel * Estimating degrees of effect robustness quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust scalar coeff_b=_b[gdppc_const] scalar se_b=_se[gdppc_const] scalar lb_b= coeff_b -invnormal(1-(100-c(level))/200)*se_b scalar ub_b= coeff_b +invnormal(1-(100-c(level))/200)*se_b quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust scalar coeff_r=_b[0.soviet_post#c.gdppc_const] scalar se_r=_se[0.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in other country years is: " robustness scalar coeff_r=_b[1.soviet_post#c.gdppc_const] scalar se_r=_se[1.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in post-Soviet period years is: " robustness ** with 1991-2008 post-Soviet dummy * Robustness test model use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace gdppc_const= gdppc_const/1000 capture dropvars soviet_post shock_period gen shock_period=(year>=1991 & year<2009 ) gen soviet_post=(soviet_core+soviet_non_core)*shock_period replace year=year-1959 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust outreg2 using table, append excel * Estimating degrees of effect robustness quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust scalar coeff_b=_b[gdppc_const] scalar se_b=_se[gdppc_const] scalar lb_b= coeff_b -invnormal(1-(100-c(level))/200)*se_b scalar ub_b= coeff_b +invnormal(1-(100-c(level))/200)*se_b quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust scalar coeff_r=_b[0.soviet_post#c.gdppc_const] scalar se_r=_se[0.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in other country years is: " robustness scalar coeff_r=_b[1.soviet_post#c.gdppc_const] scalar se_r=_se[1.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in post-Soviet period years is: " robustness ** with 1991-2011 post-Soviet dummy * Robustness test model use "Chapter_12_structuralchange.dta", clear xtset countryid year * Baseline quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust su year if e(sample) replace gdppc_const= gdppc_const/1000 capture dropvars soviet_post shock_period gen shock_period=(year>=1991 ) gen soviet_post=(soviet_core+soviet_non_core)*shock_period replace year=year-1959 reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust outreg2 using table, append excel * Estimating degrees of effect robustness quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i gdppc_const i.year , robust scalar coeff_b=_b[gdppc_const] scalar se_b=_se[gdppc_const] scalar lb_b= coeff_b -invnormal(1-(100-c(level))/200)*se_b scalar ub_b= coeff_b +invnormal(1-(100-c(level))/200)*se_b quietly reg e0 alcohol_pc_comb_i lung_mort_rate_comb_i external_mort_rate_comb_i soviet_post#c.gdppc_const soviet_post i.year , robust scalar coeff_r=_b[0.soviet_post#c.gdppc_const] scalar se_r=_se[0.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in other country years is: " robustness scalar coeff_r=_b[1.soviet_post#c.gdppc_const] scalar se_r=_se[1.soviet_post#c.gdppc_const] scalar lb1=lb_b/se_r scalar ub1=ub_b/se_r scalar lb2=lb1-(coeff_r/se_r) scalar ub2=ub1-(coeff_r/se_r) scalar ubd=normal(ub2) scalar lbd=normal(lb2) scalar robustness=ubd-lbd di "Estimated degree of effect robustness in post-Soviet period years is: " robustness *********************************************************************************** ***********************************************************************************