Dear R Studio Community,
I am trying to plot 2 ROC curves in one graph to nicely compare them.
I used the "cutpointr" package and I don't know how to merge the 2 results.
y <- data[ , c( " pnf " , " lac " )] roc1 <- cutpointr( data = y , x= lac , class = pnf , method = maximize_metric, metric = sum_sens_spec, na.rm = FALSE) summary(roc1) plot(roc1) y <- data[ , c( " aed " , " lac " )] roc2 <- cutpointr( data = y , x= lac , class = aed , method = maximize_metric, metric = sum_sens_spec, na.rm = FALSE) summary(roc2) plot(roc2)
I read some previous post suggestiong to use pROC package too, and so I did
pred1 <- ifelse ( data$aed == TRUE, 1, 0) r.lac <- roc(pred1, data$lac)
but I kept stopping with an ERROR : "Error: Only strings can be converted to symbols".
Can you give me any suggestion on how to move forward?