Calculating area under curve (AUC) from Predicted Probability


SAS Analytics : Practical SAS, Statistics & Analysis Course


Data Science: Machine Learning A-Z: Hands-On Python & R In Data Science

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;
run;

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

data AUC;
set WilcoxonScore end=eof;
retain v1 v2 1;
if _n_=1 then v1=abs(ExpectedSum - SumOfScores);
v2=N*v2;
if eof then do;
d=v1/v2;
Gini=d * 2;    AUC=d+0.5;  
put AUC=  GINI=;
keep AUC Gini;
output;
end;
run;
Coursera Data Science

SAS Tutorials : 100 Free SAS Tutorials


Statistics Tutorials : 50 Statistics Tutorials

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?

    ReplyDelete

Next → ← Prev