Calculating area under curve (AUC) from Predicted Probability

This article explains a way you can calculate AUC from predicted probability column in a validation dataset.

proc logistic data=train;
model y(event="1") = entry;
score data=valid out=valpred;

ods select none;
ods output WilcoxonScores=WilcoxonScore;
proc npar1way wilcoxon data= valpred ;
where y^=.;
class y;
var  p_1;
ods select all;

data AUC;
set WilcoxonScore end=eof;
retain v1 v2 1;
if _n_=1 then v1=abs(ExpectedSum - SumOfScores);
if eof then do;
Gini=d * 2;    AUC=d+0.5;  
put AUC=  GINI=;
keep AUC Gini;
Love this Post? Spread the Word!
Comment and share to motivate us to write more!
About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 8 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Telecom and Human Resource.

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*
Related Posts:
1 Response to "Calculating area under curve (AUC) from Predicted Probability"
  1. I thought this already gets calculated by SAS and its included in the ROC chart?


We have Zero Tolerance to Spam. Comments with links will be deleted immediately upon our review.

Next → ← Prev
Scroll to Top