The default title of an ROCOverlay plot produced by PROC LOGISTIC is "ROC Curves for Comparisons". Is there an easy way to change this title?
Thanks!
The Proc Logistics Doc states you can use set the _ROCOVERLAY_ENTRYTITLE macro variable to the desired title.
Using an example from there:
%let _ROCOVERLAY_ENTRYTITLE = Whatever Title You Want;
data roc;
input alb tp totscore popind @@;
totscore = 10 - totscore;
datalines;
3.0 5.8 10 0 3.2 6.3 5 1 3.9 6.8 3 1 2.8 4.8 6 0
3.2 5.8 3 1 0.9 4.0 5 0 2.5 5.7 8 0 1.6 5.6 5 1
3.8 5.7 5 1 3.7 6.7 6 1 3.2 5.4 4 1 3.8 6.6 6 1
4.1 6.6 5 1 3.6 5.7 5 1 4.3 7.0 4 1 3.6 6.7 4 0
2.3 4.4 6 1 4.2 7.6 4 0 4.0 6.6 6 0 3.5 5.8 6 1
3.8 6.8 7 1 3.0 4.7 8 0 4.5 7.4 5 1 3.7 7.4 5 1
3.1 6.6 6 1 4.1 8.2 6 1 4.3 7.0 5 1 4.3 6.5 4 1
3.2 5.1 5 1 2.6 4.7 6 1 3.3 6.8 6 0 1.7 4.0 7 0
3.7 6.1 5 1 3.3 6.3 7 1 4.2 7.7 6 1 3.5 6.2 5 1
2.9 5.7 9 0 2.1 4.8 7 1 2.8 6.2 8 0 4.0 7.0 7 1
3.3 5.7 6 1 3.7 6.9 5 1 3.6 6.6 5 1
;
ods graphics on;
proc logistic data=roc plots(only)=roc;
LogisticModel: model popind(event='0') = alb tp totscore;
output out=LogiOut predicted=LogiPred; /* output predicted value, to be used later */
run;
data ExpertPred;
input ExpertPred @@;
datalines;
0.95 0.2 0.05 0.3 0.1 0.6 0.8 0.5
0.1 0.25 0.1 0.2 0.05 0.1 0.05 0.1
0.4 0.1 0.2 0.25 0.4 0.7 0.1 0.1
0.3 0.2 0.1 0.05 0.1 0.4 0.4 0.7
0.2 0.4 0.1 0.1 0.9 0.7 0.8 0.25
0.3 0.1 0.1
;
data Survival;
merge LogiOut ExpertPred;
run;
proc logistic data=Survival;
model popind(event='0') = LogiPred ExpertPred / nofit;
roc 'Logistic' pred=LogiPred;
roc 'Expert' pred=ExpertPred;
ods select ROCOverlay;
/* optional: for a statistical comparison, use ROCCONTRAST stmt and remove the ODS SELECT stmt */
*roccontrast reference('Expert Model') / estimate e;
run;
%symdel _ROC_ENTRYTITLE;
Result:
The Proc Logistics Doc states you can use set the _ROCOVERLAY_ENTRYTITLE macro variable to the desired title.
Using an example from there:
%let _ROCOVERLAY_ENTRYTITLE = Whatever Title You Want;
data roc;
input alb tp totscore popind @@;
totscore = 10 - totscore;
datalines;
3.0 5.8 10 0 3.2 6.3 5 1 3.9 6.8 3 1 2.8 4.8 6 0
3.2 5.8 3 1 0.9 4.0 5 0 2.5 5.7 8 0 1.6 5.6 5 1
3.8 5.7 5 1 3.7 6.7 6 1 3.2 5.4 4 1 3.8 6.6 6 1
4.1 6.6 5 1 3.6 5.7 5 1 4.3 7.0 4 1 3.6 6.7 4 0
2.3 4.4 6 1 4.2 7.6 4 0 4.0 6.6 6 0 3.5 5.8 6 1
3.8 6.8 7 1 3.0 4.7 8 0 4.5 7.4 5 1 3.7 7.4 5 1
3.1 6.6 6 1 4.1 8.2 6 1 4.3 7.0 5 1 4.3 6.5 4 1
3.2 5.1 5 1 2.6 4.7 6 1 3.3 6.8 6 0 1.7 4.0 7 0
3.7 6.1 5 1 3.3 6.3 7 1 4.2 7.7 6 1 3.5 6.2 5 1
2.9 5.7 9 0 2.1 4.8 7 1 2.8 6.2 8 0 4.0 7.0 7 1
3.3 5.7 6 1 3.7 6.9 5 1 3.6 6.6 5 1
;
ods graphics on;
proc logistic data=roc plots(only)=roc;
LogisticModel: model popind(event='0') = alb tp totscore;
output out=LogiOut predicted=LogiPred; /* output predicted value, to be used later */
run;
data ExpertPred;
input ExpertPred @@;
datalines;
0.95 0.2 0.05 0.3 0.1 0.6 0.8 0.5
0.1 0.25 0.1 0.2 0.05 0.1 0.05 0.1
0.4 0.1 0.2 0.25 0.4 0.7 0.1 0.1
0.3 0.2 0.1 0.05 0.1 0.4 0.4 0.7
0.2 0.4 0.1 0.1 0.9 0.7 0.8 0.25
0.3 0.1 0.1
;
data Survival;
merge LogiOut ExpertPred;
run;
proc logistic data=Survival;
model popind(event='0') = LogiPred ExpertPred / nofit;
roc 'Logistic' pred=LogiPred;
roc 'Expert' pred=ExpertPred;
ods select ROCOverlay;
/* optional: for a statistical comparison, use ROCCONTRAST stmt and remove the ODS SELECT stmt */
*roccontrast reference('Expert Model') / estimate e;
run;
%symdel _ROC_ENTRYTITLE;
Result:
If I read the documentation on the ROC plot these macro variables may be what you want:
- _ROC_ENTRYTITLE
sets the first title line on the ROC plot.
- _ROC_ENTRYTITLE2
sets the second title line on the ROC plot.
Example of use, again from the documentation:
%let _ROC_ENTRYTITLE=New Title; Submit PROC LOGISTIC statement %symdel _ROC_ENTRYTITLE;
@ballardw I was there too 🙂 I think those are for the pure ROC plot though and not the overlaid ROC plot?
or
- _ROCOVERLAY_ENTRYTITLE
sets the title on the overlaid ROC plot.
@PeterClemmensen wrote:
@ballardw I was there too 🙂 I think those are for the pure ROC plot though and not the overlaid ROC plot?
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.