View source: R/calculate_roc.R
calc_auc | R Documentation |
Given a ggplot object with a GeomRoc layer, computes the area under the ROC curve for each group
calc_auc(ggroc)
ggroc |
A ggplot object that contains a GeomRoc layer |
A data frame with the estimated AUCs for each panel and group
D.ex <- rbinom(50, 1, .5)
rocdata <- data.frame(D = c(D.ex, D.ex),
M = c(rnorm(50, mean = D.ex, sd = .4), rnorm(50, mean = D.ex, sd = 1)),
Z = c(rep("A", 50), rep("B", 50)))
ggroc <- ggplot(rocdata, aes(m = M, d = D)) + geom_roc()
calc_auc(ggroc)
ggroc2 <- ggplot(rocdata, aes(m = M, d = D, color = Z)) + geom_roc()
calc_auc(ggroc2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.