----------------------------------------------------------------------------------------- log: C:\MyDocs\MPH\LectureNotes\Class do, log and data files\Survival\stcurve.log log type: text opened on: 18 Nov 2005, 09:17:47 . set more on . use http://www.stata-press.com/data/r9/drugtr, clear (Patient Survival in Drug Trial) . stset -> stset studytime, failure(died) failure event: died != 0 & died < . obs. time interval: (0, studytime] exit on or before: failure ------------------------------------------------------------------------------ 48 total obs. 0 exclusions ------------------------------------------------------------------------------ 48 obs. remaining, representing 31 failures in single record/single failure data 744 total analysis time at risk, at risk from t = 0 earliest observed entry t = 0 last observed exit t = 39 . tabulate died 1 if | patient | died | Freq. Percent Cum. ------------+----------------------------------- 0 | 17 35.42 35.42 1 | 31 64.58 100.00 ------------+----------------------------------- Total | 48 100.00 . * . * Analysis A . * . stcox drug, basehc(a) failure _d: died analysis time _t: studytime Iteration 0: log likelihood = -99.911448 Iteration 1: log likelihood = -88.254734 Iteration 2: log likelihood = -88.001551 Iteration 3: log likelihood = -88.00019 Refining estimates: Iteration 0: log likelihood = -88.00019 Cox regression -- Breslow method for ties No. of subjects = 48 Number of obs = 48 No. of failures = 31 Time at risk = 744 LR chi2(1) = 23.82 Log likelihood = -88.00019 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- drug | .1327581 .0584002 -4.59 0.000 .0560555 .3144157 ------------------------------------------------------------------------------ . stcurve, hazard outfile(a, replace) . more . replace died = died & studytime <= 17 (8 real changes made) . replace studytime = min(17, studytime) (18 real changes made) . stset -> stset studytime, failure(died) failure event: died != 0 & died < . obs. time interval: (0, studytime] exit on or before: failure ------------------------------------------------------------------------------ 48 total obs. 0 exclusions ------------------------------------------------------------------------------ 48 obs. remaining, representing 23 failures in single record/single failure data 567 total analysis time at risk, at risk from t = 0 earliest observed entry t = 0 last observed exit t = 17 . tabulate died 1 if | patient | died | Freq. Percent Cum. ------------+----------------------------------- 0 | 25 52.08 52.08 1 | 23 47.92 100.00 ------------+----------------------------------- Total | 48 100.00 . * . * Analysis B . * . stcox drug, basehc(b) failure _d: died analysis time _t: studytime Iteration 0: log likelihood = -81.199233 Iteration 1: log likelihood = -71.343303 Iteration 2: log likelihood = -71.256617 Iteration 3: log likelihood = -71.25637 Refining estimates: Iteration 0: log likelihood = -71.25637 Cox regression -- Breslow method for ties No. of subjects = 48 Number of obs = 48 No. of failures = 23 Time at risk = 567 LR chi2(1) = 19.89 Log likelihood = -71.25637 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- drug | .1377155 .0666693 -4.10 0.000 .0533223 .3556781 ------------------------------------------------------------------------------ . stcurve, hazard outfile(b, replace) . more . * . * Graph hazard estimates from both analyses together . * . use b, clear (Patient Survival in Drug Trial) . rename haz1 hazcensored . merge _t using a, sort (Patient Survival in Drug Trial) . sort _t . line haz1 hazcensored _t, xlabel(0(5)30) xtick(0(1)33) . log close log: C:\MyDocs\MPH\LectureNotes\Class do, log and data files\Survival\stcurve.lo > g log type: text closed on: 18 Nov 2005, 09:18:14 ----------------------------------------------------------------------------------------