The ‘EvalTest’ package provides a ‘Shiny’ application for evaluating diagnostic test performance using data from laboratory or diagnostic research. It supports both binary and continuous test variables. It allows users to compute key performance indicators with their confidence interval and visualize Receiver Operating Characteristic (ROC) curves, determine optimal cut-off thresholds, display confusion matrix, and export publication-ready plot. It aims to facilitate the application of statistical methods in diagnostic test evaluation by healthcare professionals.
You can install the development version of ‘EvalTest’ from GitHub like so:
Or from CRAN (after the package is published there):
After installing the package, you can launch the application following these steps:
This will open the ‘Shiny’ application in your default web or your RStudio viewer.
The application is designed to be user-friendly and intuitive. Here are the steps to use it:
Upload your data in Excel format (.xlsx) by pressing the Browse button in the Data import and parameters setting panel.
Choose your variable test type (Qualitative binary 1/0 or Quantitative).
Select the appropriate columns for test variable and reference variable (disease status).
Input disease prevalence value of the study population (number between 0 and 1).
Run the analysis and explore the results in the different tabs.
You can download the ROC plot and the results tables for your report.
We can see below some screenshots of the different tabs of the application. We have ROC curve with its confidence interval, optimal cut-off point of test variable, AUC value and its confidence interval, and projection of best sensitivity and specificity according to the top-left method. We can also download the plot in PNG format.
We have also the confusion matrix where test variable was dichotomized to binary variable (positive/negative test) according the best cut-off point, with the counts of true positives, false positives, true negatives, and false negatives. We can download it in Excel file format.
We have all computed performance indicators with their estimate and confidence intervals built according to Wilson method.
The main diagnostic performance indicators computed by EvalTest are defined as follows:
The top-left method is a common approach to select
the optimal cut-off threshold from the ROC curve.
It identifies the point on the curve that is closest to the
ideal point (0,1), which corresponds to perfect sensitivity
(100%) and specificity (100%).
The optimal cut-off threshold is the value of \(t\) that minimizes this distance:
\[ t^{*} = \arg\min_{t} \; d(t) \]
For each threshold \(t\), the Euclidean distance to the point (0,1) is calculated as:
\[ d(t) = \sqrt{(1 - \text{Se}(t))^2 + (1 - \text{Sp}(t))^2} \]
where:
\[ Se = \frac{TP}{TP + FN} \]
\[ Sp = \frac{TN}{TN + FP} \]
\[ PPV = \frac{Se \times Prev}{(Se \times Prev) + (1 - Sp)(1 - Prev)} \]
\[ NPV = \frac{Sp \times (1 - Prev)}{(1 - Se) \times Prev + Sp \times (1 - Prev)} \]
\[ LR^+ = \frac{Se}{1 - Sp}, \qquad LR^- = \frac{1 - Se}{Sp} \]
\[ Acc = \frac{TP + TN}{TP + FP + FN + TN} \]
\[ J = Se + Sp - 1 \]
Let:
x
= number of “successes” (e.g. true positives for
sensitivity, true negatives for specificity)
n
= number of trials (e.g. TP + FN for sensitivity, TN + FP
for specificity)
\(\hat{p} = x/n\) = observed
proportion
\(z = z_{1-\alpha/2}\) = quantile of
the standard normal distribution (1.96 for 95% CI)
The Wilson adjusted estimate is
\[ \hat{p}_W = \frac{\hat{p} + \tfrac{z^2}{2n}}{1 + \tfrac{z^2}{n}} \]
The half-width of the confidence interval is
\[ d = \frac{z}{1 + \tfrac{z^2}{n}} \sqrt{\frac{\hat{p}(1 - \hat{p})}{n} + \frac{z^2}{4n^2}} \]
Therefore,
\[
CI_{Wilson} = [\hat{p}_W - d,\; \hat{p}_W + d]
\] In practice, the function
binom::binom.confint(method = "wilson")
is applied.
\[ CI_{PPV} = \left[ \min_{Se,Sp} f(Se,Sp), \; \max_{Se,Sp} f(Se,Sp) \right] \]
where \(f(Se,Sp)\) is the PPV function given above (analogous for NPV).
\[ CI_{LR} = \exp \left( \ln(LR) \pm 1.96 \times SE(\ln(LR)) \right) \]
The standard errors for LR+ et LR- used in the package are estimated from TP, FP, TN, FN counts according to the delta method:
\[ \operatorname{SE}\!\left[\ln\!\left(\mathrm{LR}^+\right)\right] = \sqrt{\frac{1-\mathrm{Se}}{TP} + \frac{\mathrm{Sp}}{FP}}, \]
\[ \operatorname{SE}\!\left[\ln\!\left(\mathrm{LR}^-\right)\right] = \sqrt{\frac{\mathrm{Se}}{FN} + \frac{1-\mathrm{Sp}}{TN}}. \]
\[ SE(J) = \sqrt{\frac{Se(1-Se)}{TP+FN} + \frac{Sp(1-Sp)}{TN+FP}} \]
and the 95% CI is:
\[ CI_J = J \pm 1.96 \times SE(J) \]
If you use ‘EvalTest’ in your research, please cite it as running the following script on Rconsole:
Or just cite as (after the package is published there):
Ayad N (2025). EvalTest: A Shiny App to Evaluate Diagnostic Tests Performance. R package version 1.0.2. CRAN. Available from: https://CRAN.R-project.org/package=EvalTest