Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeLong AUC Confidence Interval #19

Closed
anaphylacticapps opened this issue Jun 21, 2017 · 5 comments
Closed

DeLong AUC Confidence Interval #19

anaphylacticapps opened this issue Jun 21, 2017 · 5 comments

Comments

@anaphylacticapps
Copy link

anaphylacticapps commented Jun 21, 2017

I think there may be an issue with the DeLong confidence interval for AUC. When the sample size gets large, the CI goes to either 0-0 or 1-1. Here is an example:

Create ROC Objects

predictor1 <- c(runif(12000,0,0.5), runif(14472-12000, 0.5,0.75))
response1 <- rbinom(14472, size=1, p=predictor1)
roc1 <- roc(response1, predictor1)

predictor2 <- c(runif(3 * 12000,0,0.5), runif(3 * (14472-12000), 0.5,0.75))
response2 <- rbinom(3 * 14472, size=1, p=predictor2)
roc2 <- roc(response2, predictor2)

predictor3 <- c(runif(10 * 12000,0,0.5), runif(10 * (14472-12000), 0.5,0.75))
response3 <- rbinom(10 * 14472, size=1, p=predictor3)
roc3 <- roc(response3, predictor3)

Calculate AUC and CI

auc(roc1)
Area under the curve: 0.7586
ci.auc(roc1)
95% CI: 0.7506-0.7667 (DeLong)

auc(roc2)
Area under the curve: 0.7584
ci.auc(roc2)
95% CI: 0.7537-0.7631 (DeLong)

auc(roc3)
Area under the curve: 0.7561
ci.auc(roc3)
95% CI: 1-1 (DeLong)

@anaphylacticapps anaphylacticapps changed the title Delong AUC Confidence Interval DeLong AUC Confidence Interval Jun 21, 2017
@xrobin
Copy link
Owner

xrobin commented Jun 21, 2017

@sieste could you please have a look at this? It looks like the new DeLong code is returning erroneous theta values, maybe an overflow or something like that?

> pROC:::delongPlacementsCpp(roc3)$theta
[1] 15.97072

@anaphylacticapps as workaround, the old version 1.8 of pROC reports correct results, although it takes significantly more time to do so:

> ci.auc(roc3)
95% CI: 0.7567-0.7618 (DeLong)
> pROC:::delongPlacementsCpp(roc3)$theta
[1] 0.7592556

@sieste
Copy link
Contributor

sieste commented Jun 21, 2017

That should do the trick, sorry about that. I didn't expect someone would need a confidence interval at a sample size so big that it causes integer overflow ;)

Cheers, Stefan

@xrobin
Copy link
Owner

xrobin commented Jun 22, 2017

Excellent, thanks a lot for the very quick fix!

This is the same as commit e71e57b then. I'll add a check on the R side to make sure theta == auc to catch similar cases in the future. Then push a bugfix release asap.

@anaphylacticapps
Copy link
Author

Thank you, both.

@xrobin
Copy link
Owner

xrobin commented Jun 23, 2017

There is now an error message when the DeLong AUC doesn't match.

Thanks @anaphylacticapps for the report!

@xrobin xrobin closed this as completed Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants