auc: Calculate the area under an ROC curve.

Description Usage Arguments Details Value Examples

Description

Given a receiver operating characteristic (ROC) curve, calculates the area under said curve (AUC).

Usage

1
auc(fpr, tpr)

Arguments

fpr

A numeric vector, representing the false positive rate (FPR) of points on a ROC curve.

tpr

A numeric vector, representing the true positive rate (TPR) of points on a ROC curve, assumed to be corresponding to those represented in fpr.

Details

Arguments fpr and tpr must contain only values between 0 and 1, without any NA or NaN values, and must be the same length. Otherwise, auc will throw an appropriate error.

Value

The AUC.

Examples

1
2
roc.df = roc(c(1, 2, 3, 4, 4, 5), c(FALSE, FALSE, FALSE, TRUE, FALSE, TRUE))
auc(roc.df$FPR, roc.df$TPR)

Armadilloa16/roc documentation built on May 5, 2019, 7:06 a.m.