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;
use roc= option to save data and PROC SGPLOT to plot roc curve.
model ulc(event ='1') = p_1 Brav/ roc=roc_data ;
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
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.
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.
Yes, I am using Enterprise Guide. Thanks again for your help.
I will try that, thank you!
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.
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.
Ready to level-up your skills? Choose your own adventure.