简体   繁体   中英

R: AUC from pROC package

I recently came across pROC package to get AUC . In the help section, they give following example:

library("pROC")
data(aSAH)
auc(aSAH$outcome, aSAH$s100b)

In above, outcome is a factor whereas s100b is numerical .

My question is how does AUC work in this case? What threshold does it apply for s100b ? Or it does not matter?

Edit 1 The above code results in AUC = 0.73 . How do I know which threshold value was chosen to get this value?

The AUC in the auc function of pROC is the Area Under the ROC curve . Behind the scenes the function calls the roc function first, and so what you did is equivalent to:

myroc <- roc(aSAH$outcome, aSAH$s100b)
auc(myroc)

The ROC curve is obtained by calculating sensitivity and specificity for all possible thresholds. You can visualize the curve with the plot function, and the AUC is shown in grey:

plot(myroc, auc.polygon=TRUE)

ROC曲线,AUC显示为灰色

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM