confIntAUCbinorm | 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,
method = c("boot", "wald"),
replicates = 1000,
grid = 100,
var.equal = TRUE
)
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
|
grid |
Number of intervals to split |
var.equal |
Logical with default TRUE.
Are the variances assumed to be equal or not?
Only used if |
The results for method = 'boot'
are
a |
The values of a. |
b |
The values of b. |
x.val |
The values on the |
y.val |
The values on the |
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. |
The Wald approach is documented in a vignette: see
vignette("aucbinormal")
Kaspar Rufibach (method = 'boot'
) and Leonhard Held
(method = 'wald'
)
Pepe, M.S. (2003) The statistical evaluation of medical tests for classification and prediction. Oxford: Oxford University Press.
summaryROC
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.