Computes the area under the ROC curve in models with binary responses.
auc(o, p)
Numeric vector with observations, must have the same length as p
.
Numeric vector with predictions, must have the same length as o
.
Numeric, AUC value.
if(interactive()){
out <- auc(
o = c(0, 0, 1, 1),
p = c(0.1, 0.6, 0.4, 0.8)
)
}