I'm trying to build a ROC curve with data from a survey object from surveyr. But the pROC function cannot coerce a survey object back to a data frame for the analyses and it doen't work with the survey object
if (!require("pacman")) install.packages("pacman")
pacman::p_load(tidyverse, haven, survey, sjPlot, pROC, surveydata)
roccurve1 <- roc(apoio_ag ~fitted(Model1), data = psurvey)
roccurve2 <- roc(apoio_ag ~fitted(Model2), data = psurvey)
roccurve3 <- roc(apoio_ag ~fitted(Model3), data = psurvey)
Erro message Error in as.data.frame.default(data, optional = TRUE) : cannot coerce class ‘"svyrep.design"’ to a data.frame
Those are the packages and the code that I'm currently using. Anyone has an idea on how to solve that?