Hi everyone, I've been working on survival analysis for a while now and it's been a long and painful process in SAS. Any, I learned how to format the axis and titles of the plots generated. However, I would now like to format the legend values. I basically have four lines on my plot for the 4 treatments investigated. Instead of these treatments appearing as 1, 2 , 3 and 4, I would like to label them properly. Any ideas on how to do that? Below is the code that I've used so far. I think I should add some proc commands in there to do what I want to do, but don't know how or where. proc template;
define statgraph Stat.PHReg.Graphics.Survival;
dynamic title1 title2 title3 title4 xviewMin xviewMax group groupIndex groupName plotCL plotHPD
transparency piecewise _byline_ _bytitle_ _byfootnote_;
BeginGraph;
entrytitle "Survival with BC by soft drink consumption" TITLE3;
entrytitle TITLE2 TITLE4 / textattrs=GRAPHVALUETEXT;
layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=XVIEWMAX)) yaxisopts=(label=
"All-cancer Survival Probability" shortlabel="All-cancer Survival" linearopts=(viewmin=0.5 viewmax=1 tickvaluelist=(
0 .2 .4 .6 .8 1.0)));
if (PLOTCL)
bandplot LimitLower=LOWERSURVIVAL LimitUpper=UPPERSURVIVAL x=TIME / group=GROUP index=
GROUPINDEX modelname="Survival" datatransparency=transparency;
endif;
if (PLOTHPD)
bandplot LimitLower=LOWERHPDSURVIVAL LimitUpper=UPPERHPDSURVIVAL x=TIME / group=GROUP
index=GROUPINDEX modelname="Survival" datatransparency=transparency;
endif;
if (EXISTS(PIECEWISE))
seriesplot y=SURVIVAL x=TIME / group=GROUP index=GROUPINDEX name="Survival";
else
stepplot y=SURVIVAL x=TIME / group=GROUP index=GROUPINDEX name="Survival";
endif;
if (EXISTS(GROUP))
discretelegend "Survival" / location=inside title="Freq. of soft drinks" autoalign=(Bottom BottomLeft Top TopRight);
endif;
endlayout;
if (_BYTITLE_)
entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
else
if (_BYFOOTNOTE_)
entryfootnote halign=left _BYLINE_;
endif;
endif;
EndGraph;
end;
... View more