tsset id year local DIR = "C:\" /*change relative path to the directory where the files are located */ cd "`DIR'" *Table1 xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr lwb,fe outreg using "Table1", 3aster replace nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr limf limf_sba,fe outreg using "Table1", 3aster app nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr limf limf_sba if year >1985,fe outreg using "Table1", 3aster app nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr lwb limf limf_sba,fe outreg using "Table1", 3aster app nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr lwb limf limf_sba if year >1985,fe outreg using "Table1", 3aster app nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr limf limf_sba lwb lida_dis0_gdp librd_dis0_gdp lsba_dis_gdp lprgf_dis0_gdp,fe outreg using "Table1", 3aster app nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr limf limf_sba lwb lida_dis0_gdp librd_dis0_gdp lsba_dis_gdp lprgf_dis0_gdp if year>1985,fe outreg using "Table1", 3aster app nol ivprobit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr (lwb = l.inlineyng7 l.debt_gdp), cluster(country) outreg using "Table1-IVprobit", 3aster replace nol ivprobit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr (limf limf_sba = l.inlineyng7 l.debt_gdp), two outreg using "Table1-IVprobit", 3aster nol app ivprobit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr (limf limf_sba = l.inlineyng7 l.debt_gdp) if year>1985, two outreg using "Table1-IVprobit", 3aster app nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb limf limf_sba, gmmstyle (l.crises lwb limf limf_sba,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb limf limf_sba using "Table1-GMM", 3aster replace addstat(" Number of Instruments", e(j), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Hansen Test (p-value)", e(hansenp)) nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb limf limf_sba if year>1985, gmmstyle (l.crises lwb limf limf_sba,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb limf limf_sba using "Table1-GMM", 3aster app addstat(" Number of Instruments", e(j), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Hansen Test (p-value)", e(hansenp)) nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb lida_dis0_gdp librd_dis0_gdp limf limf_sba lsba_dis_gdp lprgf_dis0_gdp, gmmstyle (l.crises lwb lida_dis0_gdp librd_dis0_gdp limf limf_sba lsba_dis_gdp lprgf_dis0_gdp,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb lida_dis0_gdp librd_dis0_gdp limf limf_sba lsba_dis_gdp lprgf_dis0_gdp using "Table1-GMM", 3aster app addstat(" Number of Instruments", e(j), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Hansen Test (p-value)", e(hansenp)) nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb lida_dis0_gdp librd_dis0_gdp limf limf_sba lsba_dis_gdp lprgf_dis0_gdp if year >1985, gmmstyle (l.crises lwb lida_dis0_gdp librd_dis0_gdp limf limf_sba lsba_dis_gdp lprgf_dis0_gdp,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb lida_dis0_gdp librd_dis0_gdp limf limf_sba lsba_dis_gdp lprgf_dis0_gdp using "Table1-GMM", 3aster app addstat(" Number of Instruments", e(j), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Hansen Test (p-value)", e(hansenp)) nol *Table2 xtabond2 crises t1-t37 l.crises lgr lwb lwbgr polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges, gmmstyle (l.crises lwb lwbgr,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr lwb lwbgr using "Table2", replace 3aster addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) local int "cab cpi wbavg resi" foreach x of local int { xtabond2 crises t1-t37 l.crises l`x' lwb lwb`x' polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr, gmmstyle (l.crises lwb lwb`x',c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l`x' lwb lwb`x' using "Table2", app 3aster addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) } *Table3 xtabond2 crises t1-t37 l.crises lgr limf limfgr polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges, gmmstyle (l.crises limf limfgr,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr limf limfgr using "Table3", replace 3aster addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) local int "cab cpi imfavg resi" foreach x of local int { xtabond2 crises t1-t37 l.crises l`x' limf limf`x' polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr, gmmstyle (l.crises limf limf`x',c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l`x' limf limf`x' using "Table3", app 3aster addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) } *Table4 xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr l.wb_own l.wb_inh,fe outreg using "Table4", 3aster replace nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr l.imf_own l.imf_inh,fe outreg using "Table4", 3aster app nol xtlogit crisesadj yrsaftcrises crises_spline1 crises_spline2 crises_spline3 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr l.wb_own l.wb_inh l.imf_own l.imf_inh,fe outreg using "Table4", 3aster app nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l.wb_own l.wb_inh, gmmstyle (l.crises l.wb_own,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l.wb_own l.wb_inh using "Table4", 3aster app addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l.imf_own l.imf_inh, gmmstyle (l.crises l.imf_own,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l.imf_own l.imf_inh using "Table4", 3aster app addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) nol xtabond2 crises t1-t37 l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l.wb_own l.wb_inh l.imf_own l.imf_inh, gmmstyle (l.crises l.wb_own ,c) ivstyle (t1-t37 polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges lgr) small two robust nod outreg l.crises polity2 durable lnriots lndemons lnstrike lnguerilla lnassas lnpurges lgr l.wb_own l.wb_inh l.imf_own l.imf_inh using "Table4", 3aster app addstat(" Number of Instruments", e(zcols), "AR1 Test (p-value)", e(ar1p), "AR2 Test (p-value)", e(ar2p), "Sargan-Hansen Test (p-value)", e(sarganp)) nol *Figure1 local int "resi" foreach x of local int { xtlogit crisesadj l`x' lwb lwb`x' yrsaftcrises crises_spline1 crises_spline2 crises_spline3 lgr polity2 durable lnguerilla lnriots lndemons lnstrike lnassas lnpurges,fe predict ycw`x' if e(sample), pu0 predictnl dwb`x'_i = (_b[lwb]+_b[lwb`x']*l`x')*ycw`x'*(1- ycw`x'), se(sewb`x'_i) gen pw`x'1 = dwb`x'_i-1.645*sewb`x'_i gen pw`x'2 = dwb`x'_i+1.645*sewb`x'_i scatter dwb`x'_i l`x' if e(sample) || line dwb`x'_i pw`x'1 pw`x'2 l`x' if e(sample), pstyle(p2 p3 p3) sort legend(off) graph export "Figure1.emf", replace drop ycw`x' dwb`x'_i pw`x'1 pw`x'2 sewb`x'_i }