version 9 capture log close set more off log using ehe3.log, replace use rrdat1, clear gen des = tfin ~= ti /*destination state*/ gen tf = tfin - tstart + 1 /*ending time*/ gen newid = _n stset tf, failure(des) id(newid) /*define single episode data*/ 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*/ stsplit time, at(0,24,60) /*split records*/ tab time, ge(t) /*generate time dummies*/ *generate period-specific dummies for any edu edu edu \ any t1 t2 t3: gen eduY = X*Y for any coho2 coho2 coho2 \ any t1 t2 t3: gen coho2Y= X*Y for any coho3 coho3 coho3 \ any t1 t2 t3: gen coho3Y= X*Y for any lfx lfx lfx \ any t1 t2 t3: gen lfxY = X*Y for any pnoj pnoj pnoj \ any t1 t2 t3: gen pnojY = X*Y for any pres pres pres \ any t1 t2 t3: gen presY = X*Y stset tf, failure(des) id(newid) /*define single episode data*/ streg t1 t2 t3 edut* coho2t* coho3t* lfxt* pnojt* prest*, /// dist(exp) nohr noconstant /*fit piecewise constant exponential model*/ log close