Evaluating Binary Diagnostic Tests with EBDT

Authors: Miguel Angel Montero-Alonso & Juan de Dios Luna del Castillo.
Package: ebdt v1.0.1

Introduction

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:

  • Agresti, A., (2002). Categorical Data Analysis. John Wiley and Sons, New York.
  • Agresti, A., Coull, B.A., (1998). Approximate is better than ‘exact’ for interval estimation of binomial proportions. The American Statistician, 52:119 – 126.
  • Gart, J.J., Nam J., (1988). Aproximate interval estimation of the ratio of binomial parameters: a review and corrections for skewness. Biometrics, 44: 323 – 338.
  • Montero-Alonso, M.A. (2010). Intervalos de confianza y contrastes de hipotesis para parametros de tests diagnosticos binarios. Universidad de Granada. http://hdl.handle.net/10481/4879
  • Simel D.L., Samsa, G.P., Matchar, D.B., (1991). Likelihood ratios with confidence: sample size estimation for diagnostic test studies. J. Clin Epidemiology, 44(8): 763-770.
  • Roldán Nofuentes J.A., Luna del Castillo J.D., Montero Alonso, M.A., (2009). Confidence intervals of weighted kappa coefficient of a binary diagnostic test. Communications in Statistics. Simulation and Computation, 38: 1562 – 1578.
  • Pepe, M. S. (2003). The statistical evaluation of medical tests for classification and prediction. Oxford University Press.
  • Zhou, X.-H., Obuchowski, N. A., y McClish, D. K. (2011). Statistical Methods in Diagnostic Medicine (2.ª ed.). John Wiley & Sons.
  • Quick Start

    library(ebdt)
    ebdt(s1 = 40, r1 = 5, s0 = 10, r0 = 45)

    The 2x2 Table

    A binary diagnostic test produces a 2x2 contingency table:

    Outcome +Outcome -Total
    Test +TP (s1)FP (r1)n1
    Test -FN (s0)TN (r0)n2
    TotalnCasesnControlsn

    Study Types

    Cross-sectional / Prospective (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.

    Retrospective / Case-Control (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)

    Individual Metrics

    Sensitivity

    ebdt_se(40, 5, 10, 45)

    Specificity

    ebdt_sp(40, 5, 10, 45)

    Youden Index

    ebdt_you(40, 5, 10, 45)

    Positive Predictive Value (PPV)

    ebdt_ppv(40, 5, 10, 45)

    Negative Predictive Value (NPV)

    ebdt_npv(40, 5, 10, 45)

    Positive Likelihood Ratio (LR+)

    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.

    Negative Likelihood Ratio (LR-)

    ebdt_nlr(40, 5, 10, 45)

    Prevalence (cross-sectional only)

    ebdt_prev(40, 5, 10, 45)

    Weighted Kappa Coefficient

    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.

    Confidence Interval Methods

    ParameterMethod
    Se, Sp, PPV, NPVAgresti-Coull
    Prevalence<Agresti-Coull
    Youden IndexNormal approx. (delta method)
    LR+, LR-Simel (log-normal) + Gart & Nam
    Weighted KappaWald + Logit

    Zero-Cell Correction

    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)

    Return Values (Programmatic Use)

    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

    FunctionReturn 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

    Shiny App

    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.

    Reading from Excel

    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
    Note: The readxl package must be installed to use ebdt_from_excel(). Install it with install.packages("readxl").

    GitHub

    All content and source code on this site is available in our GitHub repository.



    Package ebdt v1.0.1 — Universidad de Granada