Hi again SAS communities
i'm working on a KM curve plotting gender (female vs male survival) and for the life of me I cannot figure out how to get my lines to be different colors
They're both blue here, and I'd like the female line to be red--and have that shown in the legend label. I feel like I've looked all over the internet and SAS communities to figure it out, and I see absolutely nothing. I'd also like to stay away from Macros if possible. I don't know how to use it.
This is what I have currently:
libname Hetal "\\tuftsmc\home\hpatel3\SAS Datasets";
run;
ods graphics on/attrpriority=color;
ods select all;
ods output survivalplot=genderobs;
proc lifetest data=hetal.gender_obskm conftype=loglog plot=(s) plots=(survival(CL strata=panel))
timelist=(1 5 10) outs=Survival_Rates reduceout alpha=.05;
/* Surival_rates gives you confidence intervals in "output data" tab*/
time FU_time*NYHA_stat(0);
strata gender / test= logrank;
by gender;
where NYHA_Stat=1 AND Obst_Stat=1;
Title "Male patients with obstructive HCM in NYHA Stage III/IV";
run;
proc sgplot data=genderobs noborder nowall cycleattrs;
step x=Time y=Survival/ group=gender lineattrs=(color=darkblue thickness=2 pattern=solid) name="s"
legendlabel="obstructive";
format gender genfmt.;
xaxis display=(noticks) label="Years" values=(0 to 10 by 5) min=0 max=10 labelattrs=(size=10 weight=bold );
yaxis label='Survival Probability' values=(0 to 1.0 by 0.2) min=0 max=1.0 labelattrs=(size=10 weight=bold);
run;
ods graphics off;
I think what's wrong is the specific line I've bolded above, but I really don't know at this point what to change. I would settle for females being a dashed line if that's easier. Really just something to differentiate.
Here is what my curve currently looks like:
