BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LzyButEfficient
Calcite | Level 5

Hi,

I want to plot an overall KM curve and subgroups KM curves on the same plot.  I can't seem to find how to do this, all examples I've seen only have subgroups but not overall.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @LzyButEfficient and welcome to the SAS Support Communities (as a contributor)!

 

If the graph does not contain statistics about group comparisons, you can simply create a new input dataset from the existing one with a new group "Overall" (in the STRATA variable) comprising all observations. Here's how you would create it from sashelp.bmt (which is used in the PROC LIFETEST documentation):

data want;
set sashelp.bmt;
output;
group='Overall';
output;
run;

 

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @LzyButEfficient and welcome to the SAS Support Communities (as a contributor)!

 

If the graph does not contain statistics about group comparisons, you can simply create a new input dataset from the existing one with a new group "Overall" (in the STRATA variable) comprising all observations. Here's how you would create it from sashelp.bmt (which is used in the PROC LIFETEST documentation):

data want;
set sashelp.bmt;
output;
group='Overall';
output;
run;

 

LzyButEfficient
Calcite | Level 5

I just need survival curves without any group comparison statistics and this was such a simple solution that I'm upset I didn't think of it!

Thanks for your help!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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