我正在使用AUC 包在 R 中构建 ROC 图。
这些是比较生存概率与观察到的生存率的 300 点数据集的前 5 个点。
predict1 <- c(0.755, 0.755, 0.937, 0.978, 0.755)
y <- c(1,1,1,0,1)
ROC_null_a <- auc(roc(predict1, as.factor(y)))
plot(roc(predict1, as.factor(y)))
我想更改 ROC 图的截止值。文档描述了这些值,但没有指定如何在 roc 或 auc 函数中实际使用它们:
“价值
包含以下元素的列表:
cutoffs A numeric vector of threshold values
fpr A numeric vector of false positive rates corresponding to the threshold values
tpr A numeric vector of true positive rates corresponding to the threshold values"
示例仅包括基本功能,不演示使用截止、tpr 或 fpr。
我不知道如何将截止值合并到 roc 函数中。以前有人在 AUC 包中使用过截止值吗?我知道它可以用其他包来完成,但如果可能的话,我想坚持使用这个包,因为我的数据和代码已经为它设置好了。