我正在尝试使用pROC
R 中的包来计算灵敏度、特异性和阈值水平。这是一个示例数据
library(pROC)
x<-sample(0:1,7974,replace=T)
y<-sample(0:16049.2,7974,replace=T)
myroc<-roc(x,y)
coords(myroc, "best", ret=c("threshold", "sensitivity", "specificity"))
Error in UseMethod("coords") :
no applicable method for 'coords' applied to an object of class "c('double', 'numeric')"
谁能告诉我为什么会发生此错误以及如何解决?
谢谢