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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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