version 9 capture log close set more off log using ehf3.log, replace use rrdat1, clear gen des = tfin ~= ti /*destination state*/ gen ts = 0 /*starting time*/ 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*/ gen marrdate = tmar - tstart /*variables for episode splitting*/ gen entrymarr = marrdate>0 & marrdate 0 /*time-dependent dummy variable*/ stset t1, failure(des) id(newid) /*define single episode data*/ streg edu coho2 coho3 lfx pnoj pres marr, dist(exp) nohr /*fit parametric survival model*/ * percentage change in the rate: entry into marriage display (exp(_b[marr])-1)*100 gen marrmen= sex==1 & marrdat <= ts & tmar >0 /*interaction effect*/ streg edu coho2 coho3 lfx pnoj pres marr marrmen, /// dist(exp) nohr /*fit parametric survival model*/ log close