Can someone explain to me how to use boot.roc (from fbroc package)

Hello,
I have created an ROC curve from a multivariable logistic regression. I am trying to do a bootstrap of the ROC but I keep getting a wide range of errors, so I assume I do not understand boot.roc from the fbroc package. I have read the page about boot.roc from boot.roc function - RDocumentation but I guess I do not understand it. I would appreciate any help. Here is the code:

model.multivar<-glm((y)~ a+b+c+d+e+f,family=binomial,data=data)
predicted <- predict(model.multivar, type="response")
install.packages("pROC")
library(pROC)
ROCC<-roc(data$y, predicted, na.rm = TRUE)
install.packages('fbroc')
library(fbroc)

#what do I put here?
boot.roc(pred, true.class, stratify = TRUE, n.boot = 1000,
use.cache = FALSE, tie.strategy = NULL)

#I would assume pred=predicted, true.class=ROCC? but when I do that I get "Error in boot.roc(pred = predicted, true.class = ROCC, stratify = TRUE, :
Predictions and true classes need to have the same length"

Thank you so much!

See the FAQ: How to do a minimal reproducible example reprex for beginners for how to make a complete working example. Without data it's hard to tell much. Have you checked

length(pred) #predicted?
length(ROCC)

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.