powered by
The function computes AUC.
AUC(x, y, group, switchAUC = TRUE)
AUC value.
numeric vector.
numeric vector. If missing, group has to be specified.
group
grouping vector or factor.
logical value. Switch AUC; see Details section.
Matthias Kohl Matthias.Kohl@stamats.de
The function computes the area under the receiver operating characteristic curve (AUC under ROC curve).
If AUC < 0.5, a warning is printed and 1-AUC is returned. This behaviour can be suppressed by using switchAUC = FALSE
AUC < 0.5
1-AUC
switchAUC = FALSE
The implementation uses the connection of AUC to the Wilcoxon rank sum test; see Hanley and McNeil (1982).
J. A. Hanley and B. J. McNeil (1982). The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology, 143, 29-36.
set.seed(13) x <- rnorm(100) ## assumed as log2-data g <- sample(1:2, 100, replace = TRUE) AUC(x, group = g) ## avoid switching AUC AUC(x, group = g, switchAUC = FALSE)
Run the code above in your browser using DataLab