BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Quodly
Obsidian | Level 7

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;

 

Quodly_0-1648799422943.png

 

how can one get rid of the model statement title above the figure?

 

1 ACCEPTED SOLUTION

Accepted Solutions
bobderr
SAS Employee

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;

View solution in original post

5 REPLIES 5
sbxkoenk
SAS Super FREQ

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

GraphGuy
Meteorite | Level 14

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

 

ballardw
Super User

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.

Quodly
Obsidian | Level 7

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.

bobderr
SAS Employee

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;

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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 5 replies
  • 805 views
  • 9 likes
  • 5 in conversation