hello,
data have;
input pred resp;
datalines;
0 1
1 1
2 0
3 1
4 1
5 1
6 1
7 0
8 0
9 1
;
ods graphics on;
ods select roccurve;
ods noproctitle;
proc logistic;
model resp = pred / nofit;
roc "have" pred = pred;
run;
ods graphics off;
how can one get rid of the model statement title above the figure?
This is a title added because you specified a ROC statement, and is not controlled by the "title;" statement. The trick is to use PROC DOCUMENT to store the plot, then replay it and remove the title with OBSTITLE:
ods graphics on;
ods select roccurve;
ods noproctitle;
ods document name=myroc(write);
proc logistic data=have;
model resp = pred / nofit;
roc "have" pred = pred;
run;
ods document close;
ods graphics on;
proc document name=myroc;
obstitle \Logistic#1\ROC1#1\ROCCurve#1;
replay \Logistic#1\ROC1#1\ROCCurve#1;
quit;
ods graphics off;
I have moved this post to the 'Graphics Programming' board.
I'm confident that it will get an answer here.
I can start the discussion by saying you need to do this by changing the GRAPH(ic) template used by the LOGISTIC procedure.
I have not done that since years, so it would take me too long to offer you a ready-made solution.
But here are some references :
SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation | SAS 9.4 / Viya 3.5
SAS/STAT User's Guide
ODS Graphics Template Modification
Graph Templates
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_templt_sect001.htm
Tiptoe through the Templates
Cynthia L. Zender, SAS Institute, Inc., Cary, NC
https://www.lexjansen.com/nesug/nesug10/gr/gr10.pdf
SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation | SAS 9.4 / Viya 3.5
SAS Output Delivery System: Procedures Guide
Using the TEMPLATE Procedure
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsproc/p0qwdi9bxpdaxyn1jji920q0c8s4.htm
Introduction to the Graph Template Language
Sanjay Matange, SAS Institute, Cary, NC
https://www.lexjansen.com/wuss/2009/dpr/DPR-Matange1.pdf
Koen
I'm not 100% sure, but you'll probably have to modify the template something like this...
https://support.sas.com/kb/34/186.html
Not the most obvious but you can send the data from the graph to a data set using ODS OUTPUT and then create your own graph in Sgplot. Though that typically involves investigating the actual contents of the data set as the plotted values are likely not to stay the same name as your analysis variables.
thank you for your suggestions. i've tried
ods text = " ";
before proc logistic to hide the title - it somehow works for one procedure but not for multiple.
This is a title added because you specified a ROC statement, and is not controlled by the "title;" statement. The trick is to use PROC DOCUMENT to store the plot, then replay it and remove the title with OBSTITLE:
ods graphics on;
ods select roccurve;
ods noproctitle;
ods document name=myroc(write);
proc logistic data=have;
model resp = pred / nofit;
roc "have" pred = pred;
run;
ods document close;
ods graphics on;
proc document name=myroc;
obstitle \Logistic#1\ROC1#1\ROCCurve#1;
replay \Logistic#1\ROC1#1\ROCCurve#1;
quit;
ods graphics off;
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!
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.