confIntAUCbinorm: ROC curve and (bootstrap) confidence interval for AUC in the...

View source: R/confIntAUC.R

confIntAUCbinormR Documentation

ROC curve and (bootstrap) confidence interval for AUC in the binormal model

Description

This function computes for values of a continuous variable of a group of cases and a group of controls the ROC curve in the binormal model. Additionally, the AUC including a confidence interval is provided, with bootstrap or with Wald, assuming the variances are equal (the assumption of unequal variances has yet to be implemented).

Usage

confIntAUCbinorm(
  cases,
  controls,
  conf.level = 0.95,
  method = c("boot", "wald"),
  replicates = 1000,
  grid = 100,
  var.equal = TRUE
)

Arguments

cases

Values of the continuous variable for the cases.

controls

Values of the continuous variable for the controls.

conf.level

Confidence level for confidence interval.

method

Either "boot" for bootstrap CI or "wald" for a Wald CI.

replicates

Number of boostrap replicates. Only used if method = 'boot'.

grid

Number of intervals to split [0, 1]. Used to compute the ROC curve if method = 'boot'.

var.equal

Logical with default TRUE. Are the variances assumed to be equal or not? Only used if method = 'wald'. Currently, only var.equal = TRUE is supported.

Value

The results for method = 'boot' are

a

The values of a.

b

The values of b.

x.val

The values on the x-axis of a ROC plot.

y.val

The values on the y-axis of a ROC plot, i.e. the binormal ROC curve.

auc

Area under the ROC curve.

lowBootCI

Lower limit of bootstrap confidence interval.

upBootCI

Upper limit of bootstrap confidence interval.

The results for method = 'wald' are

a

The values of a.

b

The values of b.

auc

Area under the ROC curve.

lowCI

Lower limit of confidence interval.

upCI

Upper limit of confidence interval.

Note

The Wald approach is documented in a vignette: see vignette("aucbinormal")

Author(s)

Kaspar Rufibach (method = 'boot') and Leonhard Held (method = 'wald')

References

Pepe, M.S. (2003) The statistical evaluation of medical tests for classification and prediction. Oxford: Oxford University Press.

See Also

summaryROC

Examples


## simulate data
## --------------
set.seed(1977)
controls <- rnorm(n = 50)
cases <-  rnorm(n = 40, mean = 0.5, sd = 1.5)

## summary of ROC curve
## --------------
res <- summaryROC(cases = cases, controls = controls, conf.level = 0.95)


## alternative bootstrap CI for AUC
## --------------
resBinormBoot <- confIntAUCbinorm(cases = cases, controls = controls, 
                                  conf.level = 0.95, replicates = 1000,
                                  grid = 100)

## alternative bootstrap CI for AUC 
## --------------
resBinormWald <- confIntAUCbinorm(cases = cases, controls = controls,
                                  conf.level = 0.95, method = "wald")

## display results
## --------------
str(res)
str(resBinormBoot)
str(resBinormWald)

## plot ROC curve
## --------------
plot(x = 0, y = 0, xlim = c(0, 1), ylim = c(0, 1), type = "l", 
     xlab = "1 - specificity", ylab = "sensitivity", pty = "s")
segments(x0 = 0, y0 = 0, x1 = 1, y1 = 1, lty = 2)
lines(x = res$x.val, y = res$y.val, type = 'l', col = 2, lwd = 2, lty = 2)
lines(x = resBinormBoot$x.val, y = resBinormBoot$y.val, type = "l",
      col = 4, lwd = 2, lty = 2)


felix-hof/biostatUZH documentation built on Sept. 27, 2024, 1:48 p.m.