Learn R Programming

nsROC (version 1.1)

ROCbands: 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, ...)
# S3 method for default
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 gROC function.

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

\(\alpha_1\) in "PSN" approach a number in (0,1) affecting the width between the lower band and the ROC curve estimate. Default: NULL, the one which minimizes the theoretical area between lower and upper bands is considered.

s

scale parameter used to compute the smoothed kernel distribution functions in "PSN" method. The bandwidth \(h = s \cdot min(m,n)^{1/5} \cdot \hat{\sigma}\) where \(m\) and \(n\) stand by the number of controls and cases, respectively, is considered. Default: 1.

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 conf.level are displayed.

plot.var

if TRUE, a plot of \(\sigma_n^{*,1}(t)\) with \(t\) in [0,1] (if "PSN" method is selected) or \(Var(\Psi(p))\) with \(p\) in (a.J, b.J) (if "JMS" method is selected) is displayed.

seed

seed used to compute the bootstrap controls and cases samples in "PSN" method or Brownian Bridges in "JMS" method.

additional arguments for ROCbands. Ignored.

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 \(t \in\) {0, 1/Ni, 2/Ni, ..., 1}. In case of "JMS" method p is considered as \(t\).

practical.area

area between lower and upper bands (L and U) computed by trapezoidal rule.

Ni

number of subintervals of the unit interval considered to build the curve.

ROC.t

vector of values of \(R(t)\) for each \(t \in\) {0, 1/Ni, 2/Ni, ..., 1}.

If the method is "PSN":

s

scale parameter used to compute the smoothed kernel distribution functions.

alpha1, alpha2

if the alpha1 input argument is not specified, \(\alpha_1\) and \(\alpha_2\) values which minimize area between bands are automatically computed. If alpha1 is chosen by the user, alpha2 is computed by alpha1 = (1 - conf.level) - alpha1.

fixed.alpha1

if TRUE, alpha1 has been fixed by the user.

c1, c2

\(c_{\alpha_1}\) and \(c_{\alpha_2}\) resulting from the algorithm to compute confidence bands.

ROC.B

matrix of size Ni+1, B whose columns contain the ROC curve estimate for each bootstrap sample.

sd.PSN

vector \(\sigma_n^*(t)\) which is the estimate of the standard deviation of the empirical process considered.

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 (a.J, b.J).

smoothROC.p

smooth ROC curve estimate for each value of p.

K.alpha

value of \(K_{a,b}^\alpha\) computed to calculate confidence bands (see Details above).

var.JMS

value of \(Var(\Psi(p))\) estimated from the formula given by Hsieh and Turnbull (see Jensen et al. in References).

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.

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(.)]\) and \(n\) 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(.)]\) with \(N\) 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 of Ni 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.

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

Run this code
# NOT RUN {
# 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)
# }
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab