confIntAUCbinorm: Function to compute ROC curve and (bootstrap) confidence...

Description Usage Arguments Value Note Author(s) References Examples

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

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

Arguments

cases

Values of the continuous variable for the cases.

controls

Values of the continuous variable for the controls.

ci.method

Method of calculating the confidence interval. Implemented are boot for bootstrap and wald for the Wald based confidence interval.

conf.level

Confidence level for confidence interval.

replicates

Number of boostrap replicates. Only needed if ci.method = 'boot'.

grid

The interval [0, 1] is split in grid intervals to compute the ROC curve on. Only needed if ci.method = 'boot'.

var.equal

Logical, are the variances assumed to be equal or not (only TRUE implemented). Only needed if ci.method = 'wald'.

Value

The results for ci.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 ci.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 (ci.method = 'boot') and Leonhard Held (ci.method = 'wald')

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
set.seed(1977)
ns <- c(50, 40)
truth <- c(rep(0, ns[1]), rep(1, ns[2]))
estimates <- c(rnorm(ns[1]), rnorm(ns[2], mean = 0.5, sd = 1.5))
cases <- estimates[truth == 1]
controls <- estimates[truth == 0]
res <- summaryROC(cases, controls, conf.level = 0.95)

## ci.method = 'boot'
## --------------
resBinorm <- confIntAUCbinorm(cases, controls, 
    conf.level = 0.95, replicates = 1000, grid = 100)

# display results
res
resBinorm

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

## ci.method = 'wald'
## --------------
resBinorm <- confIntAUCbinorm(cases, controls, conf.level = 0.95, ci.method = "wald")

biostatUZH documentation built on May 2, 2019, 6:06 p.m.