I'm trying to plot the ROC with AUR in R using the package pROC. The plot is good for now (maybe) but I'm trying also to obtain the best threshold value from this plot. I'm getting a negative value and I don't know why, if someone can help me I'll be vary thankful.
The code for now is
install.packages("pROC")
library(pROC)
pre <- predict(QualityLog,qualityTrain)
modelroc <- roc(qualityTrain$PoorCare,pre)
plot(modelroc,
print.auc = TRUE,
auc.polygon = TRUE,
max.auc.polygon = TRUE,
legacy.axes = TRUE,
auc.polygon.col = "skyblue",
print.thres = "best",
print.auc.x = 0.4,
print.auc.y = 0.2)
dev.off()
coord <- coords(modelroc, "best", input="threshold", ret = "threshold")
where QualityLog is my logistic model and the qualityTrain is the data that I'm working with.
The plot for now is this: ROC