ROCbands {nsROC} | R Documentation |
Confidence bands for ROC curves
Description
This function computes and plots confidence bands for ROC curves (both left/right-sided and general one) using three different procedures. Particularly, one parametric approach assuming the binormal model (Demidenko) and two non-parametric techniques (Jensen et al. and Martinez-Camblor et al.). See References below.
Usage
ROCbands(groc, ...)
## Default S3 method:
ROCbands(groc, method = c("PSN", "JMS", "DEK"), conf.level = 0.95,
B = 500, bootstrap.bar = TRUE, alpha1 = NULL, s = 1, a.J = NULL, b.J = NULL,
plot.bands = FALSE, plot.var = FALSE, seed = 123, ...)
Arguments
groc |
a 'groc' object from the |
method |
method used to compute the confidence bands. One of "PSN" (Martinez-Camblor et al.), "JMS" (Jensen et al.) or "DEK" (Demidenko). |
conf.level |
the width of the confidence band as a number in (0,1). Default: 0.95, resulting in a 95% confidence band. |
B |
number of bootstrap replicates. Default: 500 (only used in "PSN" and "JMS" methods). |
bootstrap.bar |
if TRUE, a bar showing bootstrap replication progress is displayed. |
alpha1 |
|
s |
scale parameter used to compute the smoothed kernel distribution functions in "PSN" method. The bandwidth |
a.J , b.J |
extremes of interval in (0,1) in which compute the regional confidence bands by "JMS" methodology. Default: (1/Ni, 1 - 1/Ni.). |
plot.bands |
if TRUE, confidence bands at level |
plot.var |
if TRUE, a plot of |
seed |
seed used to compute the bootstrap controls and cases samples in "PSN" method or Brownian Bridges in "JMS" method. |
... |
additional arguments for |
Details
Martinez-Camblor et al. methodology - "PSN"
method
The
theoretical.area
is computed as(c_{\alpha_1} - c_{\alpha_2}) n^{-1/2} \int \sigma_n^*(t) dt
where\sigma_n^*(t)
is the standard deviation estimate of\sqrt{n} [\hat{R}(\omega, .) - R(.)]
andn
is the cases sample size.Due to computation can take some time depending on the number of bootstrap replicates considered, a progress bar is shown.
Confidence bands are truncated in the following way: on one hand, if the lower band is lower than 0 or higher than 0.95 it is forced to be 0 or 0.95, respectively; on the other hand, if the upper band is higher than 1 or lower than 0.05 it is forced to be 1 or 0.05, respectively.
Jensen et al. methodology - "JMS"
method
K^\alpha_{a,b}
denote the upper\alpha/2
-quantile of the distribution of\sup_{a \le p \le b} \frac{|\Psi(p)|}{\sqrt{Var \Psi(p)}}
where(a,b)
is the interval in which the regional confidence bands are calculated and\Psi(.)
is the limiting process of the stochastic process\Delta_N = \sqrt{N} [\hat{R}(\omega, .) - R(.)]
withN
being the total sample size.Extremes of the interval (
a.J
,b.J
) used in order to display the regional confidence bands must be divisors ofNi
in the interval[0,1]
.Confidence bands are truncated in a similar way as in "PSN" method in order not to have bands lower than 0 or higher than 1.
Demidenko methodology - "DEK"
method
Demidenko ROC curve estimate does not correspond to the empirical one due to the fact that the (bio)marker values in controls and cases are supposed to come from a normal distribution is exploited.
Value
A list of class 'rocbands' with the following content:
method |
method used to compute the confidence bands. One of "PSN" (Martinez-Camblor et al.), "JMS" (Jensen et al.) or "DEK" (Demidenko). |
conf.level |
the width of the confidence band as a number in (0,1). |
B |
number of bootstrap replicates used in "PSN" and "JMS" methods. |
L , U |
vectors containing the values of lower and upper bands, respectively, for each |
practical.area |
area between lower and upper bands ( |
Ni |
number of subintervals of the unit interval considered to build the curve. |
ROC.t |
vector of values of |
If the method
is "PSN":
s |
scale parameter used to compute the smoothed kernel distribution functions. |
alpha1 , alpha2 |
if the |
fixed.alpha1 |
if TRUE, |
c1 , c2 |
|
ROC.B |
matrix of size |
sd.PSN |
vector |
theoretical.area |
theoretical area between confidence bands by trapezoidal rule. |
If the method
is "JMS":
a.J , b.J |
extremes of the interval in which the regional confidence bands have been computed. |
p |
vector of FPR points considered in the interval ( |
smoothROC.p |
smooth ROC curve estimate for each value of |
K.alpha |
value of |
var.JMS |
value of |
If the method
is "DEK":
DEK.fpr , DEK.tpr |
values of FPR and TPR computed to calculate the Demidenko confidence bands taking into account that it is a binormal technique. |
Note
Brownian bridges needed to estimate \Psi(.)
in "JMS" method are computed using the BBridge
function in the sde
package.
It should be noted that both the "PSN" and "JMS" methods are non-parametric, while the "DEK" approach is designed assuming the binormal model, so it is not convenient to use this method when distribution assumptions are not fulfilled. Furthermore, both the "JMS" and "DEK" methodologies are implemented just for the right-sided ROC curve. If side
is left
or both
only the "PSN" method provides confidence bands.
References
Martinez-Camblor P., Perez-Fernandez S., Corral N., 2016, Efficient nonparametric confidence bands for receiver operating-characteristic curves, Statistical Methods in Medical Research, DOI: 10.1177/0962280216672490.
Jensen K., Muller H-H., Schafer H., 2000, Regional confidence bands for ROC curves, Statistical in Medicine, 19, 493-509.
Demidenko E., 2012, Confidence intervals and bands for the binormal ROC curve, Journal of Applied Statistics, 39(1), 67-79.
Examples
# Basic example
set.seed(123)
X <- c(rnorm(45), rnorm(30,2,1.5))
D <- c(rep(0,45), rep(1,30))
groc.obj <- gROC(X,D)
# PSN confidence bands with conf.level=0.95
ROCbands(groc.obj)
# Plot standard deviation estimate of the curve and confidence bands in the same window
ROCbands(groc.obj, plot.bands=TRUE, plot.var=TRUE)
# PSN confidence bands with alpha1 fixed (alpha1=0.025)
ROCbands(groc.obj, alpha1=0.025)
# JMS confidence bands in (0.2,0.7) interval
ROCbands(groc.obj, method="JMS", a.J=0.2, b.J=0.7)
# Plot variance estimate of the curve and confidence bands in the same window
ROCbands(groc.obj, method="JMS", a.J=0.2, b.J=0.7, plot.bands=TRUE, plot.var=TRUE)
# DEK confidence bands with conf.level=0.99
ROCbands(groc.obj, method="DEK", conf.level=0.99)