options ls=80; libname fu '../../sdata'; data temp (keep=age sex censor resc); set fu.dialoutp; resc = -nresc; /* Cox-Snell residual */ proc lifetest outsurv=dialkm noprint; time resc*censor(0); data tmp0(keep=resc survival); set dialkm; /* remove the censored and one without log */ if resc = 0 or survival = 0 then delete; data tmp1; set tmp0; h = -log(survival); proc print; filename gsasfile 'dialcs.gsf'; goptions reset = all gunit = pct border ftext=swissb htitle=6 htext=2.5 gaccess = gsasfile ROTATE=LANDSCAPE gsfmode=replace device=ps; axis1 label=(h=2 f=swiss 'Cox-Snell residual'); axis2 label=(h=2 f=swiss a=90 'cumulative hazard of residual'); title 'Cumulative hazard plot of the Cox-Snell residuals'; proc gplot data=tmp1; plot h*resc / vaxis=axis2 haxis=axis1 cframe=white; symbol1 interpol=j h=1 l=2 v=square c=black; run;