FOCUS AREAS

Graphics

Product-Limit Survival Estimates
Base SAS: ODS Graphics Procedure: SGPLOT

%let gpath='.';
%let dpi=100;

ods _all_ close;
ods listing style=htmlblue image_dpi=&dpi gpath=&gpath; 

/*--Get survival plot data from LIFETEST procedure--*/
ods graphics on;
ods output Survivalplot=SurvivalPlotData;
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500);
   time T * Status(0);
   strata Group / test=logrank adjust=sidak;
   run;

/*--Survival Plot with outer Risk Table using AxisTable--*/
ods graphics / reset width=5in height=3in imagename='1L_Survival_Plot_SG_V94';
title 'Product-Limit Survival Estimates';
title2  h=0.8 'With Number of AML Subjects At-Risk';
proc sgplot data=SurvivalPlotData;
  step x=time y=survival / group=stratum lineattrs=(pattern=solid thickness=2) 
       name='s' curvelabel splitchar='-';
  scatter x=time y=censored / markerattrs=(symbol=circlefilled) name='c';
  scatter x=time y=censored / markerattrs=(symbol=circlefilled) GROUP=stratum;
  xaxistable atrisk / x=tatrisk location=outside class=stratum colorgroup=stratum
             valueattrs=(size=8) labelattrs=(size=8);
  keylegend 'c' / location=inside position=topright;
run;

title;
title2;