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.
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;
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;
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!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.