Hi all,
I need advice on how to "plot lines for multiple groups within a sas variable". I used proc lifetest to get output dataset and used proc gplot to produce an rtf file.
proc lifetest data= abc method=KM outsurv=xyz plot=(s); time duration*censor (1,2);
strata group ; run;
The variable "group" has "6 categories" and proc gplot gives me plot points by default so I used symbol statement with i=spline option, but it gave me a line graph for only one group
Here is the code:
proc gplot data = xyz;
symbol1 i=spline;
plot survival*duration= group / vaxis=axis1 haxis=axis2 legend=legend1;;
run;
How can I get line graphs for all the categories within the group? Thanks.
If you submit
ODS GRAPHICS ON;
before your PROC LIFETEST call, the procedure should produce a survival plot automatically.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.