# dataset is assigned to jv jv <- read.csv(file.choose() ) # Choose jv.csv to import it as an R object jv into R # install.packages("pROC") library(pROC) rocjv <- roc(jv$intubated, jv$wbc1) coords(rocjv, "best") coords(rocjv, x = "best", input = "threshold", best.method = "youden") # AUC plot: library(pROC) plot.roc(jv$intubated, jv$wbc1, print.auc = TRUE, ci = TRUE) plot.roc(jv$intubated, jv$wbc1, print.auc = TRUE, ci = TRUE, # adding color col = "darkblue" ) # AUC calculation (using an alternative package): library("psych") auc(jv$intubated, jv$wbc1)