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