BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Befikadu
Fluorite | Level 6

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;

 

 

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

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;

View solution in original post

3 REPLIES 3
Befikadu
Fluorite | Level 6

My current output and a sample of desired output...

PeterClemmensen
Tourmaline | Level 20

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2678 views
  • 3 likes
  • 2 in conversation