如何在邏輯回歸中得到ROC的最佳截止點作為數字

[英]How can I get The optimal cutoff point of the ROC in logistic regression as a number


I would like to get the optimal cut off point of the ROC in logistic regression as a number and not as two crossing curves. Using the code below I can get the plot that will show the optimal point but in some cases I just need the point as a number that I can use for other calculations. Here are the code lines:

我想在邏輯回歸中得到ROC的最佳截止點作為數字而不是兩條交叉曲線。使用下面的代碼,我可以得到將顯示最佳點的圖,但在某些情況下,我只需要將該點作為可用於其他計算的數字。以下是代碼行:

library(Epi)
ROC( form = IsVIP ~ var1+var2+var3+var4+var5, plot="sp", data=vip_data ) 

Thanks

1 个解决方案

#1


11  

As per documentation the optimal cut-off point is defined as the point where Sensitivity + Specificity is maximal (see MX argument in ?ROC). You can get the according values as follows (see example in ?ROC):

根據文檔,最佳截止點定義為靈敏度+特異性最大的點(參見?ROC中的MX參數)。您可以按如下方式獲取相應值(請參閱?ROC中的示例):

x <- rnorm(100)
z <- rnorm(100)
w <- rnorm(100)
tigol <- function(x) 1 - (1 + exp(x))^(-1)
y <- rbinom(100, 1, tigol(0.3 + 3*x + 5*z + 7*w))
rc <- ROC(form = y ~ x + z, plot="sp") 
## optimal combination
opt <- which.max(rowSums(rc$res[, c("sens", "spec")]))
## optimal cut-off point 
rc$res$lr.eta[opt]

This is the point that will be shown when you run

這是您運行時將顯示的點

ROC(form = y ~ x + z, plot = "ROC", MX = TRUE)

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/04/17/724f2e9ae718e17fdba391686b7600e8.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com