version 9 set scheme sj capture log close set more off log using ehi10.log, replace use rrdat1, clear gen des = tfin ~= ti /*destination state*/ gen tf = tfin - tstart + 1 /*ending time*/ gen coho2 = tb >= 468 & tb <= 504 /*cohort 2*/ gen coho3 = tb >= 588 & tb <= 624 /*cohort 3*/ gen lfx = tstart - te /*labor force experience*/ gen pnoj = noj - 1 /*previous number of jobs*/ stset tf, failure(des) stcox edu coho2 coho3 lfx pnoj pres, nohr basesurv(s) basehc(h) basec(c) stcurve, survival /* at mean values of all predictors */ stcurve, cumhaz at1(coho3=1 edu=13 lfx=5 pnoj=1 pres=30) /// at2(coho2=1 edu=13 lfx=5 pnoj=1 pres=30) /// at3(coho2=0 coho3=0 edu=13 lfx=5 pnoj=1 pres=30) /// legend(row(3)) saving("Figure 9_4_1",replace) stcurve, hazard at1(coho3=1 edu=13 lfx=5 pnoj=1 pres=30) /// at2(coho2=1 edu=13 lfx=5 pnoj=1 pres=30) /// at3(coho2=0 coho3=0 edu=13 lfx=5 pnoj=1 pres=30) /// kernel(gauss) legend(row(3)) saving("Figure 9_4_2",replace) drop s h c log close