use http://www.stata-press.com/data/r8/leukemia, clear stset weeks, fail(relapse) sts list if treatment1 == 1 * 1.2 At 23 weeks, the survivor function drops from 0.54 to 0.45 * 1.3 Total in the Net Lost column is 12 sts list if treatment1 == 0 * 1.4 8 weeks * 1.5 None * 1.6 Median survival before relapse is better on Drug A (23 weeks) than standard treatment (8 weeks) sts graph, by(treatment1) graph export graph1.eps, replace * 1.7 Yes, survival appears to be better on Drug A sts graph, by(treatment1) yline(0.5) graph export graph2.eps, replace sts graph, by(treatment1) yline(0.5) lost graph export graph3.eps, replace * 1.9 12 on Drug A, 0 on standard treatment, as before sts graph, by(treatment1) yline(0.5) lost gwood graph export graph4.eps, replace * 1.10 Confidence bands get wider since they are based on smaller numbers sts test treatment1 * 1.11 Yes, there are far fewer relapses on Drug A than expected sts test treatment1, wilcoxon * 1.12 Yes, the results are very similar sts graph, by(wbc3cat) graph export graph5.eps, replace * 2.1 Yes, survival is best in the Normal group and worst in the High group tab wbc3cat treatment1, co * 2.2 No, there are more in the High category on standard treatment than Drug A * 2.3 Survival would be worse in the standard treatment arm stcox treatment1 * 2.4 HR = 0.22, 95% CI = 0.10, 0.49 xi: stcox treatment1 i.wbc3cat * 2.5 HR = 0.28, 95% CI = 0.12, 0.66 * 2.6 The beneficial effect of Drug A was exaggerated by the difference in white blood cell counts between the groups stcoxkm, by(treatment1) graph export graph6.eps, replace * 2.7 Yes stcoxkm, by(wbc3cat) graph export graph7.eps, replace * 2.8 Yes xi: stcox treatment1 i.wbc3cat, sca(sca*) sch(sch*) stphtest * 2.9 Yes stphtest, detail * 2.10 No, the PH assumption holds for all three variables sts graph, by(treatment2) graph export graph8.eps, replace * 3.1 Survival on drug B is worse than standard treatment for the first 10 weeks * 3.2 After 10 weeks, survival is better on Drug B than standard treatment stcoxkm, by(treatment2) graph export graph9.eps, replace * 3.3 The observed curves cross, the predicted curves do not xi: stcox treatment2 i.wbc3cat * 3.4 No, the HR is 0.85, but this reduction is not statistically significant drop sca* sch* xi: stcox treatment2 i.wbc3cat, sca(sca*) sch(sch*) stphtest * 3.5 No: the test shows a significant departure from proportional hazards stphtest, detail * 3.6 Ony the treatment variable does not satisfy the PH assumption sts list gen id = _n stset weeks, fail(relapse) id(id) stsplit split_time, at(10) sts list * 3.10 Yes list id weeks relapse split_time _t0 _t in 1/45 gen t1 = treatment2 * (split_time == 0) gen t2 = treatment2 * (split_time == 10) xi: stcox t1 t2 i.wbc3cat * 3.13 HR for the first 10 weeks == 2.13 (95% CI = 0.83, 5.47) * 3.14 HR for after 10 weeks = 0.11 (95% CI = 0.02, 0.58) * 3.15 Yes: risk was elevated at first, then reduced drop sca* sch* xi: stcox t1 t2 i.wbc3cat, sca(sca*) sch(sch*) stphtest * 3.16 Yes, the model is now appropriate stphtest, det * 3.17 None of the variables depart from the PH assumption