BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
Rick_SAS
SAS Super FREQ

Most SAS data analysts know that you can fit a logistic model in PROC LOGISTIC and create an ROC curve for that model, but did you know that PROC LOGISTIC enables you to create and compare ROC curves for ANY vector of predicted probabilities regardless of where the predictions came from? 

 

For example, you can fit a random-intercept model by using PROC GLIMMIX or use survey weights in PROC SURVEYLOGISTIC, then use the predicted values from those models to produce an ROC curve for the comparisons. You can even overlay multiple ROC curves in one graph.

 

If Pred1 and Pred2 are two vectors of predicted probabilities, the following syntax creates and overlays the ROC curves:

 

ods graphics on;
proc logistic data=Have;
   model Y = Pred1 Pred2 / nofit;
   roc 'Model1' pred=Pred1;
   roc 'Model2' pred=Pred2;
   roccontrast reference('Model1') / estimate e; /* optional: compare curves */
run;

For more information, see "Create and compare ROC curves for any predictive model."

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Visit a random SAS tip This SAS Tips board is not open for replies or comments, but we welcome your feedback and questions. Have a question or comment about this tip? Start a new topic in one of our discussion boards, and reference this tip topic.
Discussion stats
  • 0 replies
  • 976 views
  • 3 likes
  • 1 in conversation