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

Good afternoon,

I am looking for the AUC value (Area Under the Curve or ROC Index) in SAS Enterprise Miner in SAS 9.3. I have explored all the options from the ROC curve graph (see pic) and from the nodes I am using (logistic regression, decision trees and neural nets) without any success.


Many thanks in advance.

Capture.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
WendyCzika
SAS Employee

You need to attach a Model Comparison node to the modeling node(s) that you are running, then in the Results for Model Comparison, if you look in the Statistics Comparison table, the row where Fit Statistics="_AUR_" corresponds to the area under the ROC curve.  The KS statistic is reported in that table as well.

Hope that helps!

View solution in original post

3 REPLIES 3
Quentin
Super User

I'm don't use Enterprise Miner but I've calculated AUC using PROC LOGISTIC.  It looks like EM is generating SAS code in the background perhaps (similar to DI studio?).  If so, is there somwhere you can see PROC LOGISTIC code which you would be able to edit by hand?  Can you show the current PROC LOGISTIC code?

 

You would want to insert a ROC statement within the PROC LOGISTIC step. 

The Boston Area SAS Users Group is hosting free webinars!
Next up: Bart Jablonski and I present 53 (+3) ways to do a table lookup on Wednesday Sep 18.
Register now at https://www.basug.org/events.
rayIII
SAS Employee

Hi. You could compute AUC from the dataset that EM uses to display the ROC chart in the Model Comparison node. 

 

Here's some basic code that uses the formula for the area of a trapezoid. Put it in a SAS Code node after your Model Comparison node and run it.  (disclaimer:  untested code.)

 

The code assumes you have a single model (i.e., just one modeling node is hooked up to the Model Compare node) and that the nodeID of your model comparison is 'MdlComp'. 

 

data roc;
retain AUC ;
set &em_lib..mdlcomp_emroc (where=(model ne " _Baseline_"));
avgHeight = (sensitivity + lag1(sensitivity)) / 2;
width = oneminusspecificity - lag1(oneminusspecificity);
smallArea = avgHeight * width;
AUC + smallArea;
run;

 

*last row contains (total) AUC;
proc print data = roc;
var sensitivity avgHeight width oneMinusSpecificity smallArea AUC;
run;

 

Hope this helps.

 

Ray

WendyCzika
SAS Employee

You need to attach a Model Comparison node to the modeling node(s) that you are running, then in the Results for Model Comparison, if you look in the Statistics Comparison table, the row where Fit Statistics="_AUR_" corresponds to the area under the ROC curve.  The KS statistic is reported in that table as well.

Hope that helps!

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!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 13165 views
  • 2 likes
  • 4 in conversation