I`m trying to plot some ROC curves. Most of my models result from the glm-function and I can easily plot ROC curves with the pROC-package.
Now my problem: For two of my models I had to use Firth`s logistic regression because of complete separation. The logistf function works just fine, but when I try to plot a ROC curve from that model, R tells me "No valid data provided." Which makes perfect sense, because the roc-function from pROC seems to need a vector from the "glm " or "lm" class. The logistf function gives me a "logistf" class.
Example of the working code here:
mort_glm.x <- glm(death ~ x, family = binomial(), data = data)
roc.x <- roc(data$death, mort_glm.x$fitted.values, plot=TRUE, print.auc = TRUE, legacy.axes = TRUE)```
Logistf-Code:
mort_logistf.y <- logistf(death ~ y, data = data)
roc.y <- roc(data$death, mort.y$fitted.values, plot=TRUE, print.auc = TRUE, legacy.axes = TRUE)
*Error in roc.default(data$death, mort30_logistf.y$fitted.values, : No valid data provided.*
Is it possible to use pROC for this? Should I try to change the class of mort_logistf.y?
But wouldn`t that ruin my penalization?
Or should I use a different package for the ROC_plot?
Generally, I am less interested in the plot than in the AUC, but if there is a solution to get both, I would be happy with that too.