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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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