BookmarkSubscribeRSS Feed
mdmorris
Calcite | Level 5
Hello--

I have three k-m curves that I'd like to plot on the same graph (thus showing three lines). Can someone help me with the syntax to achieve this? The time units are the same for the three models which will allow for them to be displayed on the same figure.

I greatly appreciate any suggestions anyone has! Been stumped for quite some time about this.
MDM
2 REPLIES 2
DanH_sas
SAS Super FREQ
Here are a couple of approaches. The SGPLOT approach works only for SAS 9.2 or greater:

[pre]
proc sgplot data=survdata;
step x=time y=surv1;
step x=time y=surv2;
step x=time y=surv3;
run;


symbol1 i=stepj;
proc gplot data=survdata;
plot (surv1 surv2 surv3)*time / overlay;
run;
quit;
[/pre]

Hope this helps,
Dan
mdmorris
Calcite | Level 5
YAY! Thank you so much. I ended up having to use the syntax with 'overlay' specified.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 778 views
  • 0 likes
  • 2 in conversation