Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

AUC

Area Under the ROC Curve


Description

This function calculates Area Under the ROC Curve (AUC). The AUC can be defined as the probability that the fit model will score a randomly drawn positive sample higher than a randomly drawn negative sample. This is also equal to the value of the Wilcoxon-Mann-Whitney statistic. This function is a wrapper for functions from the ROCR package.

Usage

AUC(predictions, labels, label.ordering = NULL)

Arguments

predictions

A vector of predictions, or predicted probabilities, for each observation.

labels

A binary vector containing the true values for each observation. Must have the same length as predictions.

label.ordering

The default ordering of the classes can be changed by supplying a vector containing the negative and the positive class label (negative label first, positive label second).

Value

The value returned is the Area Under the ROC Curve (AUC).

Author(s)

Erin LeDell ledell@berkeley.edu

References

References to the underlying ROCR code, used to calculate area under the ROC curve, can be found on the ROCR homepage at: http://rocr.bioinf.mpi-sb.mpg.de

See Also

Examples

library(cvAUC)

data(ROCR.simple)
auc <- AUC(ROCR.simple$predictions, ROCR.simple$labels)
# [1] 0.8341875

cvAUC

Cross-Validated Area Under the ROC Curve Confidence Intervals

v1.1.0
Apache License (== 2.0)
Authors
Erin LeDell, Maya Petersen, Mark van der Laan
Initial release
2014-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.