confIntAUCbinorm {biostatUZH} | R Documentation |
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).
confIntAUCbinorm(cases, controls, conf.level = 0.95, replicates = 1000, grid = 100, ci.method = c("boot", "wald"), var.equal = TRUE)
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 |
conf.level |
Confidence level for confidence interval. |
replicates |
Number of boostrap replicates. Only needed if |
grid |
The interval [0, 1] is split in |
var.equal |
Logical, are the variances assumed to be equal or not (only |
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. |
The Wald approach is documented in a vignette: see vignette("aucbinormal")
Kaspar Rufibach (ci.method = 'boot'
) and Leonhard Held (ci.method = 'wald'
)
Pepe, M.S. (2003) The statistical evaluation of medical tests for classification and prediction. Oxford: Oxford University Press.
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")