Dear all,
I finally found out that the Template used to display the panels is Stat.Lifetest.Graphics.ProductLimitSurvivalPanel. I am tring to customise this to the way I want
but I will need a little bit help. I wish to have a different color for each panel. In my case I have four panels. I realise if I make changes to the section if PLOTCENSORED it affects the 4 panels but I want to define for example these colours (blue green gray red) each one colour should affect the corresponding panel, the following features: plotband, plotatrisk, plotlegend and group title.
I will also wish to change the x-axis label, I can't really findout I to do that. I will appreciate any help
Here is the code:
proc template;
source Stat.Lifetest.Graphics.ProductLimitSurvivalPanel;
define statgraph Stat.Lifetest.Graphics.ProductLimitSurvivalPanel;
dynamic nRows nColumns method xName plotAtRisk plotCensored plotCL plotHW plotEP plotBand
plotLegend labelCL labelHW labelEP HeaderDisplay PanelNum yMin xtickVals xtickValFitPol
maxTime _byline_ _bytitle_ _byfootnote_;
BeginGraph;
entrytitle " Patients BMT";
*if (PLOTATRISK)
entrytitle " " / textattrs=GRAPHVALUETEXT;
*endif;
layout datapanel classvars=(STRATUM) / rowaxisopts=(display=(ticks tickvalues) altdisplay=(
ticks tickvalues) linearopts=(viewmin=YMIN viewmax=1 tickvaluelist=( .2 .4 .6 .8 1.0)))
headerlabeldisplay=HEADERDISPLAY rows=NROWS columns=NCOLUMNS columnaxisopts=(shortlabel=
XNAME linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS tickvaluefitpolicy=
XTICKVALFITPOL)) cellheightmin=10 cellwidthmin=10 rowdatarange=unionall columndatarange=
unionall panelnumber=PANELNUM start=TOPLEFT skipemptycells=TRUE order=PACKED shrinkfonts=
TRUE;
layout prototype;
if (PLOTHW)
if (PLOTEP)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false
modelname="Survival" fillattrs=GRAPHDATA1 datatransparency=.55 name="HW"
legendlabel=LABELHW;
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false
modelname="Survival" fillattrs=GRAPHDATA2 datatransparency=.55 name="EP"
legendlabel=LABELEP;
else
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false
modelname="Survival" fillattrs=GRAPHCONFIDENCE name="HW" legendlabel=LABELHW;
endif;
else
if (PLOTEP)
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false
modelname="Survival" fillattrs=GRAPHCONFIDENCE name="EP" legendlabel=LABELEP ;
endif;
endif;
if (PLOTCL)
if (PLOTBAND)
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false
modelname="Survival" display=(outline) outlineattrs=GRAPHPREDICTIONLIMITS
name="CL" legendlabel=LABELCL;
else
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false
modelname="Survival" fillattrs=GRAPHCONFIDENCE name="CL" legendlabel=LABELCL;
endif;
endif;
stepplot x=TIME y=SURVIVAL / name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT)
tiplabel=(_tip1="Anzahl mit Risiko" _tip2="Beobachtete Ereignisse") tip=(x y _tip1
_tip2) legendlabel="Überleben";
if (PLOTCENSORED)
scatterplot y=CENSORED x=TIME / tiplabel=(y="Survival Probability")
markerattrs=(symbol=circlefilled color=darkred size=5px ) name="Censored" legendlabel="Zensiert";
endif;
if (PLOTATRISK)
scatterplot x=TATRISK y=Y2 / markercharacter=ATRISK ;
endif;
endlayout;
sidebar / align=left;
entry "Survival Probaility" / textattrs=GRAPHLABELTEXT rotate=90;
endsidebar;
if (PLOTLEGEND)
sidebar / align=bottom;
discretelegend 'Censored' 'CL' 'HW' 'EP' / across=4;
endsidebar;
endif;
endlayout;
if (_BYTITLE_)
entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
else
if (_BYFOOTNOTE_)
entryfootnote halign=left _BYLINE_;
endif;
endif;
EndGraph;
end;
run;
ods graphics on;
proc lifetest data=sashelp.BMT plots=(s(cb=hw test ATRISK strata=panel));
time T * Status(0);
strata Group;
run;
ods graphics off;
... View more