xrobin / pROC

Display and analyze ROC curves in R and S+
https://cran.r-project.org/web/packages/pROC/
GNU General Public License v3.0
121 stars 31 forks source link

Default method parameter in ci.auc function is different from documentation #126

Closed fquehenberger closed 8 months ago

fquehenberger commented 8 months ago

The function ci.roc is described as "This function computes the confidence interval (CI) of an area under the curve (AUC). By default, the 95% CI is computed with 2000 stratified bootstrap replicates.". However, the default method is "delong"

Steps to reproduce the behavior:

data(aSAH) roc1 <- roc(aSAH$outcome, aSAH$s100b) ci.auc(roc1) 95% CI: 0.6301-0.8326 (DeLong)

The default result is DeLong!

ci.auc(roc1,method="bootstrap") 95% CI: 0.6239-0.8271 (2000 stratified bootstrap replicates)

The excpected result would be (2000 stratified bootstrap replicates)!

  1. What command did you run?

    data(aSAH) roc1 <- roc(aSAH$outcome, aSAH$s100b) ci.auc(roc1)

  2. What error or output did you get?

95% CI: 0.6301-0.8326 (DeLong)

Expected behavior

95% CI: 0.6239-0.8271 (2000 stratified bootstrap replicates)

sessionInfo() R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale: [1] LC_COLLATE=German_Austria.1252 LC_CTYPE=German_Austria.1252 LC_MONETARY=German_Austria.1252 LC_NUMERIC=C LC_TIME=German_Austria.1252

time zone: Europe/Vienna tzcode source: internal

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] pROC_1.18.5

loaded via a namespace (and not attached): [1] compiler_4.3.1 plyr_1.8.9 tools_4.3.1 Rcpp_1.0.12

xrobin commented 8 months ago

Thanks for the report, that's a good catch!

The default method for ci.auc depends on the input. It's documented in the details section, but clearly this statement in the description is wrong. I removed it and it will be available in the next release.