Data visualization with SAS programming

Proc Lifetest- plotting multiple lines on one graph

Reply
New Contributor
Posts: 2

Proc Lifetest- plotting multiple lines on one graph

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
SAS Super FREQ
Posts: 889

Re: Proc Lifetest- plotting multiple lines on one graph

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
New Contributor
Posts: 2

Re: Proc Lifetest- plotting multiple lines on one graph

YAY! Thank you so much. I ended up having to use the syntax with 'overlay' specified.
Ask a Question
Discussion stats
  • 2 replies
  • 149 views
  • 0 likes
  • 2 in conversation