Authors: Miguel Angel Montero-Alonso & Juan de Dios Luna del Castillo.
Package: ebdt v1.0.1
The ebdt package evaluates the quality of a binary diagnostic test under complete verification. It computes point estimates and confidence intervals for sensitivity, specificity, Youden index, positive and negative predictive values, positive and negative likelihood ratios, weighted kappa coefficient, and disease prevalence, for both, cross-sectional (prospective) and retrospective study designs.
Reference:
library(ebdt)
ebdt(s1 = 40, r1 = 5, s0 = 10, r0 = 45)
A binary diagnostic test produces a 2x2 contingency table:
| Outcome + | Outcome - | Total | |
|---|---|---|---|
| Test + | TP (s1) | FP (r1) | n1 |
| Test - | FN (s0) | TN (r0) | n2 |
| Total | nCases | nControls | n |
study = TRUE)All quality parameters are estimable:
ebdt(40, 5, 10, 45, study = TRUE, conflev = 0.95)
Computed: Sensitivity, Specificity, Youden Index, Prevalence, PPV, NPV, PLR, NLR, Weighted Kappa.
study = FALSE)Only Se, Sp, Youden, PLR, and NLR are estimable (prevalence, PPV, NPV not defined under retrospective sampling):
ebdt(40, 5, 10, 45, study = FALSE, conflev = 0.95)
ebdt_se(40, 5, 10, 45)
ebdt_sp(40, 5, 10, 45)
ebdt_you(40, 5, 10, 45)
ebdt_ppv(40, 5, 10, 45)
ebdt_npv(40, 5, 10, 45)
ebdt_plr(40, 5, 10, 45)
Two confidence intervals are provided: Simel (log-normal, delta method on log LR+) and Gart & Nam (exact, inverting the score statistic). The narrower interval is recommended.
ebdt_nlr(40, 5, 10, 45)
ebdt_prev(40, 5, 10, 45)
ebdt_kap(40, 5, 10, 45)
Kappa is computed for c = 0.1, 0.2, ..., 0.9. Both Wald and Logit-transformed confidence intervals are provided.
| Parameter | Method |
|---|---|
| Se, Sp, PPV, NPV | Agresti-Coull |
| Prevalence< | Agresti-Coull |
| Youden Index | Normal approx. (delta method) |
| LR+, LR- | Simel (log-normal) + Gart & Nam |
| Weighted Kappa | Wald + Logit |
When any cell of a related pair contains a zero, the Haldane-Anscombe continuity correction (+0.5) is applied to both cells of that pair:
A warning is issued when the correction is applied.
ebdt(0, 5, 10, 45, quiet = TRUE)
All functions return structured lists in addition to printing to the console:
res <- ebdt_se(40, 5, 10, 45)
res$est # point estimate
res$ci_lower # lower CI bound
res$ci_upper # upper CI bound
res$ci_method # "Wilson" or "Agresti-Coull"
res_plr <- ebdt_plr(40, 5, 10, 45)
res_plr$gartnam_ci_lower
res_plr$gartnam_ci_upper
res_kap <- ebdt_kap(40, 5, 10, 45)
head(res_kap, 3)
| Function | Return elements |
|---|---|
| ebdt_se() | est, se, ci_lower, ci_upper, ci_method, conf_level |
| ebdt_sp() | est, se, ci_lower, ci_upper, ci_method, conf_level |
| ebdt_you() | est, se, ci_lower, ci_upper, ci_method, conf_level, youden_note |
| ebdt_ppv() | est, se, ci_lower, ci_upper, ci_method, conf_level |
| ebdt_npv() | est, se, ci_lower, ci_upper, ci_method, conf_level |
| ebdt_plr() | est, se, simel_ci_*, gartnam_ci_*, conf_level |
| ebdt_nlr() | est, se, simel_ci_*, gartnam_ci_*, conf_level |
| ebdt_prev() | est, se, ci_lower, ci_upper, ci_method, conf_level |
| ebdt_kap() | data.frame: c_index, Kappa, StdError, CI_Wald_*, CI_Logit_*, Best |
| ebdt() | Named list of all applicable results + Execution_Time |
The package includes an interactive Shiny application:
shiny::runApp(system.file("app", package = "ebdt"))
and you can also find it at:
https://migmontal.shinyapps.io/ebdt/
Features: manual entry of TP/FP/FN/TN counts, Excel (.xlsx) upload with 2x2 table auto-population, study type selection, individual metric or all-metric mode, and text file export.
ebdt_from_excel("test_ebdt.xlsx")
ebdt_from_excel("test_ebdt.xlsx", study = FALSE, conflev = 0.99)
The Excel file must contain a 2x2 numeric matrix in the top-left corner:
# Row 1: TP FP
# Row 2: FN TN
readxl package must be installed to use ebdt_from_excel().
Install it with install.packages("readxl").
All content and source code on this site is available in our GitHub repository.
Package ebdt v1.0.1 — Universidad de Granada