| Type: | Package |
| Title: | Value Added Receiver Operating Characteristics Curve |
| Version: | 1.0.0 |
| Date: | 2025-11-10 |
| Description: | A continuous version of the receiver operating characteristics (ROC) curve to assess both classification and continuity performances of biomarkers, diagnostic tests, or risk prediction models. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Depends: | R (≥ 4.5.0), pROC, graphics, stats, utils, plot3D |
| NeedsCompilation: | no |
| Packaged: | 2025-11-11 07:22:09 UTC; ychung36 |
| Author: | Yunro Chung |
| Maintainer: | Yunro Chung <yunro.chung@asu.edu> |
| Repository: | CRAN |
| Date/Publication: | 2025-11-11 07:40:02 UTC |
VAROC: value added receiver operating characteristics (ROC) curve
Description
ROC curve to visualize classification and continuity performances of biomarkers, diagnostic tests, or risk prediction models.
Usage
varoc(y,x,zlim=NULL,plot=TRUE,digits=2,pval="no",B=2000)
Arguments
y |
binary outcome, where y=1 if disease (or case) and y=0 if non-disease (or control). |
x |
continuous score, e.g. biomarker, diagnostic test, risk score. |
zlim |
minimum and maximum values of TMD, useful when comparing more than two scores (see Examples below). |
plot |
TRUE if VAROC curve is displayed. |
digits |
number of decimals. |
pval |
Bootstrap one-sided p-value if pval="yes". |
B |
Number of bootstrap samples. |
Details
The varoc function summarizes and visualizes continuity performance of x at each threshold (or cutoff) c using two key metrics: (i) tail mean difference (tmd) (or above md (amd)) and (ii) intergrated tmd (itmd). For (i), tmd(c) is true positive mean(tpm)(c) minus false positive mean(fpm)(c), where tpm(c) is E(x>c|y=1) and fpm(c) is E(x>c|y=0). For (ii), itmd is a global measure of evaluating continuity performance of x over all cutoff values, where itmd is integrated tpm minus integrated fpm.
These measures are continuous versions of ROC curve-based measures. Specifically, tpm(c) and fpm(c) are continuous versions of true positive fraction (tpf)(c) and false positive fraction (fpf)(c), where tpf(c)=P(x>c|y=1) and fpf(c)=P(x>c|y=0). Thus, the useful (or useless) x has J(c)=tpf(c)-fpf(c)>0 and tmd(c)>0 (or J(c)=0 and tmd(c)=0); and useful (or useless) x has area under the ROC curve (auc)>0.5 and itmd(c)>0 (or auc=0.5 and itmd(c)=0).
Value
res1 |
Metrics at each th (threshold): tpf, fpf, tmd=tpm-fpm, pvalue (alternative hypothesis: tpm>fpm (or tpm>0)) |
res2 |
Global metrics: auc, iptm, ifpm, itmd=itpm-ifpm, pvalue (alternative hypothesis: itpm>ifpm (or itmd>0)) |
Author(s)
Yunro Chung [aut, cre]
References
Danielle Brister and Yunro Chung, VAROC: value added receiver operating characteristics curve, Journal of Data Science (under review)
Examples
set.seed(10)
n1=n0=25
y=c(rep(1,n1),rep(0,n0))
#1. useless marker
x1=abs(c(rnorm(n1,0,1),rnorm(n0,0,1)))
fit1=varoc(y=y,x=x1,plot=FALSE)
#2. useful marker
x2=abs(c(rnorm(n1,2,1),rnorm(n0,0,1)))
fit2=varoc(y=y,x=x2,plot=FALSE)
#3. markers 1 vs 2
opar=par(mfrow=c(1,2))
zlim=range(c(fit1$res1$tmd,fit2$res1$tmd))
fit1=varoc(y=y,x=x1,zlim=zlim)
fit2=varoc(y=y,x=x2,zlim=zlim)
on.exit(par(opar))
VAROC: value added receiver operating characteristics (ROC) curve
Description
Three-dimensional VAROC curve.
Usage
varoc3d(y,x,zlim=NULL,plot=TRUE,digits=2,pval="no",B=2000)
Arguments
y |
binary outcome, where y=1 if disease (or case) and y=0 if non-disease (or control). |
x |
continuous score, e.g. biomarker, diagnostic test, risk score. |
zlim |
minimum and maximum values of TMD, useful when comparing more than two scores (see Examples below). |
plot |
TRUE if three-dimensional VAROC curve is displayed. |
digits |
number of decimals. |
pval |
Bootstrap one-sided p-value if pval="yes". |
B |
Number of bootstrap samples. |
Details
Three-dimensional version of the VAROC curve. See the varoc function in details.
Value
res1 |
Metrics at each th (threshold): tpf, fpf, tmd=tpm-fpm, pvalue (alternative hypothesis: tpm>fpm (or tpm>0)) |
res2 |
Global metrics: auc, iptm, ifpm, itmd=itpm-ifpm, pvalue (alternative hypothesis: itpm>ifpm (or itmd>0)) |
Author(s)
Yunro Chung [aut, cre]
References
Danielle Brister and Yunro Chung, Value added receiver operating characteristics curve, Journal of Data Science (under review)
Examples
set.seed(10)
n1=n0=25
y=c(rep(1,n1),rep(0,n0))
#1. useless marker
x1=abs(c(rnorm(n1,0,1),rnorm(n0,0,1)))
fit1=varoc3d(y=y,x=x1,plot=FALSE)
#2. useful marker
x2=abs(c(rnorm(n1,2,1),rnorm(n0,0,1)))
fit2=varoc3d(y=y,x=x2,plot=FALSE)
#3. markers 1 vs 2
opar=par(mfrow=c(1,2))
zlim=range(c(fit1$res1$tmd,fit2$res1$tmd))
fit1=varoc3d(y=y,x=x1,zlim=zlim)
fit2=varoc3d(y=y,x=x2,zlim=zlim)
on.exit(par(opar))