I'm trying to use three different colors and patterns for three overlaid ROC curves. I'm using the following code but it's not giving me the result I want. Any suggestions?
PROC sgplot DATA=overlayuc4 aspect=1;
title 'mytitle';
xaxis values=(0 to 1 by 0.10) grid offsetmin=.05 offsetmax=.05;
yaxis values=(0 to 1 by 0.10) grid offsetmin=.05 offsetmax=.05;
xaxis label='False Alarm Rate (1 - Specificity)';
yaxis label='Hit Rate (Sensitivity)';
lineparm x=0 y=0 slope=1 / transparency=.7;
series x=_1mspec_ y=_sensit_/ name='Outcome1' lineattrs=(pattern=solid) legendlabel='Outcome1';
series x=_1mspec_ y=_sensit_/ name='Outcome2' lineattrs=(pattern=shortdash) legendlabel='Outcome2';
series x=_1mspec_ y=_sensit_/ name='Outcome3' lineattrs=(pattern=longdash) legendlabel='Outcome3';
keylegend 'Outcome1' 'Outcome2' 'Outcome3';
RUN;
How about this one. proc sort data=sashelp.class out=class; by age; run; ods graphics/reset attrpriority=none; proc sgplot data=class; styleattrs datacolors=(green red) datacontrastcolors=(green red) datalinepatterns=(solid dash) ; series x=age y=height; series x=age y=weight; run;
@zglendening wrote:
I'm trying to use three different colors and patterns for three overlaid ROC curves. I'm using the following code but it's not giving me the result I want. Any suggestions?
PROC sgplot DATA=overlayuc4 aspect=1;
title 'mytitle';
xaxis values=(0 to 1 by 0.10) grid offsetmin=.05 offsetmax=.05;
yaxis values=(0 to 1 by 0.10) grid offsetmin=.05 offsetmax=.05;
xaxis label='False Alarm Rate (1 - Specificity)';
yaxis label='Hit Rate (Sensitivity)';
lineparm x=0 y=0 slope=1 / transparency=.7;
series x=_1mspec_ y=_sensit_/ name='Outcome1' lineattrs=(pattern=solid) legendlabel='Outcome1';
series x=_1mspec_ y=_sensit_/ name='Outcome2' lineattrs=(pattern=shortdash) legendlabel='Outcome2';
series x=_1mspec_ y=_sensit_/ name='Outcome3' lineattrs=(pattern=longdash) legendlabel='Outcome3';
keylegend 'Outcome1' 'Outcome2' 'Outcome3';
RUN;
1. What does 'not giving me the result I want' mean?
2.Ideally post using a sample dataset so your issue can be replicated quickly. I'm too lazy to make up data to test your code.
3. What version of SAS are you using? The graphing options have changed a lot in last iterations and that means different options are available. %put sysvlong; to get version if you don't know it.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.