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

Dear community,

 

I am having an issue with proc lifetest, ods graphics and two strata variables. I can plot Kaplan-Meier curves with each strata variable individually without issues, but if I try to plot them both at once the legend disappears. I tried turning it back on with maxlegendarea=100 but it does not help.

With ods graphics turned off the legend is there but the graph looks super ugly. Here is the code in question:

ods graphics on /show maxlegendarea=100;
ods escapechar="~";
ods powerpoint image_dpi=450
	file="foo.pptx";
footnote "foo~nbar~nbaz";

title "Progression Free Survival";
title2 "foo";

proc lifetest data=adtte(where=(AFL EQ "Y" and BFL EQ "N" and PARAM EQ "PFS")) plots=survival notable;
	time EVENTDY * CENSORED(1);
	strata SUBGR_A SUBGR_B;
quit;

title;
title2;
footnote;
ods powerpoint close;

I cannot share the data unfortunately. Is there any other setting controlling the presence of legend? K-M plot with 5 lines (one combination is empty) is pretty useless if one has to guess which line corresponds to which stratum.

1 ACCEPTED SOLUTION

Accepted Solutions
js5
Pyrite | Level 9 js5
Pyrite | Level 9

I solved the problem differently - it turns out formatted values were too long for displaying. Adding /nolabel was the solution.

View solution in original post

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

The legend is suppressed when the LegendOpts macro variable is null.Please use the below macro variable to suppress the legend,

please place this macro variable before the proc lifetest and run the code.

 

%let LegendOpts = ;
Thanks,
Jag
js5
Pyrite | Level 9 js5
Pyrite | Level 9

I solved the problem differently - it turns out formatted values were too long for displaying. Adding /nolabel was the solution.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1904 views
  • 1 like
  • 2 in conversation