Computes the area under the ROC curve in models with binary responses.

auc(o, p)

Arguments

o

Numeric vector with observations, must have the same length as p.

p

Numeric vector with predictions, must have the same length as o.

Value

Numeric, AUC value.

Examples

if(interactive()){

 out <- auc(
   o = c(0, 0, 1, 1),
   p = c(0.1, 0.6, 0.4, 0.8)
   )

}