I wish to display a Kaplan-Meier failure plot with a line by each of two groups. (stored in variable curvelabel as Group 1 and Group 2).
The plotting is accurate, however the legend and number-at-risk display the groups as "curvelabel=Group 1", rather than simply "Group 1". Even with instruction to the legend command, I cannot alter this legend labelling (although the command correctly overwrites the 95% CI labels)
I attach a picture which shows the issue and, beneath that, the code leading to the issue.
Any advice warmly welcomed!
Array
************************************************** *************************************
Here, the time to event data is stored as doublette and doubleevent.
Code:
label define curvelabel_ 1 "Group 1" 2 "Group 2" label values curvelabel curvelabel_ label variable curvelabel "Groupings for Failure Plot" stset doublette, f(doubleevent) sts graph, ci failure /// risktable(, size(small)) /// tmax(3660) /// ci1opts(color(blue%10)) /// ci2opts(color(red%10)) /// ytitle(Proportion Experiencing Failure) /// ylabel(0 "0" 0.25 "25" 0.5 "50" 0.75 "75" 1 "100") /// xtitle(Days Follow-up) xlabel(#8) /// title(Failures) /// by(curvelabel) /// legend (label(1 "Group 1 95% CI") label(2 "Group 1") label(3 "Group 2 95% CI") label(4 "Group 2"))
0 Response to Cannot relabel sts graph groups
Post a Comment