BookmarkSubscribeRSS Feed
Jep
Obsidian | Level 7 Jep
Obsidian | Level 7

Hello,

I am trying to customize an ROC curve that was produced by the ODS graphics. I am trying to have the legend inside the graph, not on a text box outside the graph. Below is the code that I used. Thanks.

 

ods graphics on;

   proc logistic data=score1 plots=roc(id=prob);

model ulc(event ='1') = p_1 Brav/ nofit;

     roc 'Measure' p_1 ;

     roc 'BraveValues' Brav;

     roccontrast reference('BraveValue') / estimate e;

   run;

   ods graphics off;

6 REPLIES 6
Ksharp
Super User

use roc= option to save data and PROC SGPLOT to plot roc curve.

 

model ulc(event ='1') = p_1 Brav/ roc=roc_data ;

DanH_sas
SAS Super FREQ

It is also possible to use the ODS Graphics Editor to edit the PROC LOGISTIC output and move the legend. Before you run the proc, turn on the SGE option:

 

ods graphics on;

ods html sge=on; /* or whatever destination you are using */

   proc logistic data=score1 plots=roc(id=prob);

model ulc(event ='1') = p_1 Brav/ nofit;

     roc 'Measure' p_1 ;

     roc 'BraveValues' Brav;

     roccontrast reference('BraveValue') / estimate e;

   run;

ods html sge=off; /* or whatever destination you are using */

ods graphics off;

 

You should see an additional output in the results viewer (On disk, it is a .sge file). You can double-click on it in the result viewer, or bring up the editor outside of SAS and edit the SGE file. 

 

Let me know if you need more help with this.

 

Thanks!

Dan 

Jep
Obsidian | Level 7 Jep
Obsidian | Level 7

Thanks for your help Dan. I turned on the SGE option and re-run the code as you suggested and I got the following error. Do you have any idea what might be wrong or how to fix it.

Thanks.

 

ERROR: Insufficient authorization to access /sas/config/Lev1/SASApp/sashtml2.htm.

ERROR: No body file. HTML output will not be created.

DanH_sas
SAS Super FREQ

Based on that error, it looks like you are either in a SAS/Studio or Enterprise Guide environment. In that case, I would go with @Ksharp's recommendation.

Jep
Obsidian | Level 7 Jep
Obsidian | Level 7

Yes, I am using Enterprise Guide. Thanks again for your help.

Jep
Obsidian | Level 7 Jep
Obsidian | Level 7

I will try that, thank you!

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1698 views
  • 4 likes
  • 3 in conversation