/* SAS code for fitting a proportional hazards model to the bladder cancer data */ data set1; infile "c:\stat565\data\bladder.txt"; input patient time status treat init size; x = treat-1; run; proc print data=set1; run; data set3; input x init size; datalines; 0 1 2 1 1 2 0 1 6 1 1 6 run; proc phreg data=set1; model time*status(0)= x init size /ties=efron; baseline out=set2 survival=s covariates=set3 stderr=se lower=l95 upper=u95; run; data set2; set set2; stratum=x*10+size; if(init=1); run; proc format; value stratum 2="Placebo (2cm tumor)" 6="Placebo (6cm tumor)" 12="Thiotepa (2cm tumor)" 16="Thiotepa (6cm tumor)"; run; proc print data=set2; run; /* Make some plots */ goptions targetdevice=winprtm rotate=landscape cback=white colors=(black); axis1 label=(f=swiss h=1.2 a=90 r=0 "Survivor Function") order = 0 to 1 by 0.1 length= 3.5 in w=3 value=(f=swiss h=1.0); axis2 label=(f=swiss h=1.2 "Time(months)") order = 0 to 39 by 3 value=(f=swiss h=1.0) w=3 length = 6. in; SYMBOL1 v=none H=1.5 w=6 l=1 i=join; SYMBOL2 v=none H=1.5 w=6 l=3 i=join; SYMBOL3 v=none H=1.5 w=6 l=7 i=join; SYMBOL4 v=none H=1.5 w=6 l=22 i=join; proc sort data=set2; by size x; run; PROC GPLOT DATA=set2; PLOT s*time=stratum / overlay vaxis=axis1 haxis=axis2; TITLE1 ls=0.4 H=1.5 F=swiss "Time to Bladder Cancer Tumor Recurrence"; Title2 h=1.2 F=swiss "Patients with exactly one initial tumor"; legend frame; format stratum stratum.; run;