BookmarkSubscribeRSS Feed
zglendening
Calcite | Level 5

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;

2 REPLIES 2
Ksharp
Super User
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;
 
Reeza
Super User

@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. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1746 views
  • 0 likes
  • 3 in conversation