- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I solved the problem differently - it turns out formatted values were too long for displaying. Adding /nolabel was the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 = ;
Jag
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I solved the problem differently - it turns out formatted values were too long for displaying. Adding /nolabel was the solution.