Codes for ROC.^[See childRmd/_16ROC.Rmd
file for other codes]
# library(OptimalCutpoints)
# https://tidymodels.github.io/yardstick/reference/roc_curve.html roc_fit <- yardstick::roc_curve(mydata, truth = "classification", estimate = "test", na_rm = TRUE, options = list( smooth = FALSE, print.auc = TRUE, ret = c("all_coords") ) ) ggplot2::autoplot(roc_fit)
library(pROC) m1 <- pROC::roc(mydata, "classification", "test", auc = TRUE, ci = TRUE, # plot = TRUE, # percent=TRUE, na.rm=TRUE, # smooth = TRUE, ret = "all_coords", # ret = "roc", quiet = FALSE, legacy.axes = TRUE, print.auc = TRUE, # xlab = "False Positive", # ylab = "True Positive" )
m1
pROC::roc(mydata, "polyp_rec", "size", auc = TRUE, ci = TRUE, # plot = TRUE, # percent=TRUE, na.rm=TRUE, # smooth = TRUE, # ret = "all_coords", ret = "roc", quiet = FALSE, legacy.axes = TRUE, print.auc = TRUE, # xlab = "False Positive", # ylab = "True Positive" )
which.max(m1$youden) m1[which.max(m1$youden),]
roc_obj <- pROC::roc(polyp_rec ~ size, data = mydata, auc = TRUE, ci = TRUE, plot = TRUE, # percent=TRUE, na.rm=TRUE, # smooth = TRUE, # ret = "all_coords", ret = "roc", quiet = FALSE, legacy.axes = TRUE, print.auc = TRUE, xlab = "False Positive", ylab = "True Positive" )
# devtools::install_github("sachsmc/plotROC") library(plotROC) # shiny_plotROC()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.