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

likelihood ratios (and associated CIs) from pROC #102

Open
yhpua opened this issue Jan 3, 2022 · 4 comments
Open

likelihood ratios (and associated CIs) from pROC #102

yhpua opened this issue Jan 3, 2022 · 4 comments

Comments

@yhpua
Copy link

yhpua commented Jan 3, 2022

I'm writing to ask if it is possible to add "positive and negative likelihood ratios" to the ret arg of ci.coords()?

Thank you for pROC and for considering my request!

@xrobin
Copy link
Owner

xrobin commented Jan 3, 2022

Thanks for the request, it should be feasible.
Do you have a reference for the exact formulas to calculate these 2 ratios?

@yhpua
Copy link
Author

yhpua commented Jan 4, 2022

Thank you for your kind consideration.

To compute the CIs, the 2 oft-cited references are as follows:

Simel DL, Samsa GP, Matchar DB. Likelihood ratios with confidence: sample size estimation for diagnostic test studies. J Clin Epidemiol. 1991;44:763–770. doi: 10.1016/0895-4356(91)90128-V.

Martín-Andrés A, Álvarez-Hernández M. Two-tailed approximate confidence intervals for the ratio of proportions. Stat Comput. 2014;24:65–75. doi: 10.1007/s11222-012-9353-5.

@xrobin
Copy link
Owner

xrobin commented Jul 6, 2024

This was requested on SO: https://stackoverflow.com/q/77487146/333599
See Wikipedia for the formulas: https://en.wikipedia.org/wiki/Likelihood_ratios_in_diagnostic_testing

@xrobin
Copy link
Owner

xrobin commented Jul 7, 2024

The feature is now available in the develop branch:

> data(aSAH)
> roc.s100b <- roc(aSAH$outcome, aSAH$s100b)
> coords(roc.s100b, 0.2, ret=c("t", "se", "sp", "lr_pos", "lr_neg"))
          threshold sensitivity specificity   lr_pos    lr_neg
threshold       0.2   0.6341463   0.8055556 3.261324 0.4541632

> ci.coords(roc.s100b, 0.2, ret=c("lr_pos", "lr_neg"))
95% CI (2000 stratified bootstrap replicates):
    threshold lr_pos.low lr_pos.median lr_pos.high lr_neg.low lr_neg.median lr_neg.high
0.2       0.2      2.061         3.278       6.272     0.2773        0.4532      0.6548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants