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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 1277 views
  • 0 likes
  • 2 in conversation