plot.roc 显示任意cutoff

cutoff=x
pdf("new_train_ROC.pdf",height=6,width=6)
x <- plot.roc(plot_data[,2],as.numeric(plot_data[,4]) ,ylim=c(0,1),xlim=c(1,0),
              smooth=F, #绘制平滑曲线
              ci=TRUE, 
              boot.n=100,
              main="",
              print.thres=cutoff, #把阈值写在图上,其sensitivity+ specificity之和最大
              
              lwd=2, #线的粗细
              legacy.axes=T, col="red")#

x$auc
legend.name <- paste("LncRNA Signature ","AUC",round(x$auc,4),sep=" ")


legend("bottomright", legend = legend.name, col = c("red"),lwd = 2)

dev.off()

你可能感兴趣的:(plot.roc 显示任意cutoff)