version 9 set scheme sj capture log close set more off log using ehc7.log, replace use rrdat1, clear gen des = tfin ~= ti /*destination state*/ gen tf = tfin - tstart + 1 /*ending time*/ label define sex 1 "Men" 2 "Women" label value sex sex stset tf, f(des) /*define single episode data*/ sts list, by(sex) /*List survivor and cumulative hazard functions*/ sts graph, by(sex) gwood saving("Figure 3_3_1", replace) sts test sex /*Log-rank test for equality of survivor functions*/ sts test sex, wilcoxon /*Wilcoxon (Breslow)*/ sts test sex, tware /*Wilcoxon (Taron-Ware)*/ sts test sex, peto /*Wilcoxon (Prentice)*/ log close