* Author: William D. MacMillan * Prepared for ICPSR time-series and cross-section data analysis * xtprobit, xtlogit, and interactions * 5/22/09 set more off clear set mem 500m use http://www-personal.umich.edu/~wmacmill/russetandoneilwardata.dta local model mzcowwar1 smldem20 smldep dircont majpower lndstab lncaprat allies systsize absdemdis py _spline1 _spline2 local rhs smldem20 smldep dircont majpower lndstab lncaprat allies systsize absdemdis py _spline1 _spline2 btscs mzcowwar1 year dyadid, g(py) nspline(2) xtlogit `model', i(dyadid) fe set more on more set more off scalar obsnum = _N local obsnumplusonek = obsnum+1000 set obs `obsnumplusonek' foreach var of local rhs { qui sum `var' scalar `var'mean = r(mean) qui replace `var' = `var'mean if _n>obsnum } sum smldem20 scalar smldem20stddev = sqrt(r(Var)) replace smldem20 = smldem20mean - 2*smldem20stddev if _n==(obsnum + 1) forvalues i = 2/1000 { dis "`i', " _continue qui replace smldem20 = smldem20[`i'+obsnum - 1] + smldem20stddev/250 if _n==(obsnum +`i') } predict xb predict se, stdp gen yhat = exp(xb)/(1+exp(xb)) gen yhatupper = exp(xb+1.96*se)/(1+exp(xb+1.96*se)) gen yhatlower = exp(xb-1.96*se)/(1+exp(xb-1.96*se)) twoway (rarea yhatupper yhatlower smldem20) (line yhat smldem20) if _n>obsnum, /// ti("The M.E. of Dem on War Outbreak") graphregion(ic(white) color(white)) /// ylabel(, glc(gs12) glw(thin)) legend(bmargin(zero) region(lw(thin) lc(white))) /// legend(off)