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;

SAS Tutorials : 100 Free SAS Tutorials

Statistics Tutorials : 50 Statistics Tutorials

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 and predictive modeling. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Telecom and Human Resource.

While I love having friends who agree, I only learn from those who don't.

Let's Get Connected: Email | LinkedIn

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?


Next → ← Prev