log using q9, text replace use melanoma, clear keep if stage == 1 stset surv_mm, failure(status==1) stphplot, by(year8594) xi: stcox sex year8594 i.agegrp, schoen(sch*) scaledsch(schs*) stphtest, detail drop sch* stphplot, by(agegrp) sts graph, hazard by(agegrp) xi: stcox sex year8594 i.agegrp, tvc(year8594) texp(_t >= 24) stcox sex year8594 _Iagegrp_1 _Iagegrp_2 _Iagegrp_3, tvc( _Iagegrp_1 _Iagegrp_2 _Iagegrp_3) texp(_t>=24) /* (h) Poisson regression */ use melanoma, clear keep if stage == 1 gen id=_n stset surv_mm, failure(status==1) id(id) list id surv_mm _st _d _t0 _t if id < 5 stsplit fu, at(24) list id surv_mm _st _d _t0 _t fu if id < 5, sepby(id) xi: streg sex year8594 i.agegrp*i.fu, dist(exp) log close