Hello Everyone,
I need to modify the following code to change the colours of the KM curves into different line patterns (i.e. to avoid the colours) and to change the X-axis interval into 1 year (instead of 2.5).
The dataset and the outputs I am currently getting are attached.
Thank you.
*To draw the KM curves; proc lifetest data= survival2 plots=survival intervals=0 to 14 by 1; time Years * status(0); strata group; run;
Another approach is to export the data behing the plot and use PROC SGPLOT like this
proc lifetest data= survival2 plots=survival intervals=0 to 14 by 1;
time Years * status(0);
strata group;
ods output SurvivalPlot=SurvivalPlot;
run;
ods graphics / AttrPriority=None;
ods html style=Journal;
proc sgplot data=SurvivalPlot;
step x=Time y=Survival / group=StratumNum;
xaxis min=0 max=12;
yaxis min=0 max=1;
run;
My current output and a sample of desired output...
The Documentation has plenty of examples of costumizing the Kaplan Meier Plot
Another approach is to export the data behing the plot and use PROC SGPLOT like this
proc lifetest data= survival2 plots=survival intervals=0 to 14 by 1;
time Years * status(0);
strata group;
ods output SurvivalPlot=SurvivalPlot;
run;
ods graphics / AttrPriority=None;
ods html style=Journal;
proc sgplot data=SurvivalPlot;
step x=Time y=Survival / group=StratumNum;
xaxis min=0 max=12;
yaxis min=0 max=1;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.