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
118 stars 31 forks source link

Bug in calculating DeLong's Theta - delongPlacements(roc) #35

Closed coslovskym closed 6 years ago

coslovskym commented 6 years ago

Describe the bug

While re-running (repeating a colleague's analysis) ci.auc() I received the following error message : pROC: error in calculating DeLong's theta: got 0.65441176470588235947 instead of 0.63622994652406417160. And was asked to report the bug. (sorry if report is not perfect - my first bug report, and under time pressure)

To Reproduce

  1. Session info - packages:

EDIT: posted the wrong list originally.

R version 3.5.0 (2018-04-23) Platform: x86_64-suse-linux-gnu (64-bit) Running under: openSUSE Leap 42.3

Matrix products: default BLAS: /usr/lib64/R/lib/libRblas.so LAPACK: /usr/lib64/R/lib/libRlapack.so

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

other attached packages: [1] pROC_1.12.1 epiR_0.9-96 survival_2.41-3 tableone_0.9.3 [5] xtable_1.8-2 doBy_4.6-1 ggplot2_2.2.1 someR_1.5.1

  1. What command did you run? Command - ci.aus()

  2. What data did you use? Use save(myData, file="data.RData") or save.image("data.RData")

pROC_bug.zip

  1. What error or output did you get?

Error in delongPlacements(roc) : pROC: error in calculating DeLong's theta: got 0.65441176470588235947 instead of 0.63622994652406417160. Diagnostic data saved in pROC_bug.RData. Please report this bug to https://github.com/xrobin/pROC/issues.

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

xrobin commented 6 years ago

Thank you for your detailed report.

It appears you have infinite values in the data (both controls and cases). This produces invalid ROC curves and was addressed in issue #30. I need to push this fix to CRAN, but until then I suggest you use the development version of pROC:

if (! requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("xrobin/pROC")