coords function.
By default, the 95% CI are computed with 2000 stratified bootstrap replicates.# ci.thresholds(...)
## S3 method for class 'roc':
ci.coords(roc, x,
input=c("threshold", "specificity", "sensitivity"),
ret=c("threshold", "specificity", "sensitivity"),
best.method=c("youden", "closest.topleft"), best.weights=c(1, 0.5),
conf.level=0.95, boot.n=2000,
boot.stratified=TRUE,
progress=getOption("pROCProgress")$name, ...)
## S3 method for class 'formula':
ci.coords(formula, data, ...)
## S3 method for class 'smooth.roc':
ci.coords(smooth.roc, x,
input=c("specificity", "sensitivity"), ret=c("specificity", "sensitivity"),
best.method=c("youden", "closest.topleft"), best.weights=c(1, 0.5),
conf.level=0.95, boot.n=2000,
boot.stratified=TRUE,
progress=getOption("pROCProgress")$name, ...)
## S3 method for class 'default':
ci.coords(response, predictor, ...)roc function, or a smooth.roc function.roc function.roc function.coords.
See there for more details. The only difference is on the x argument which cannot be
name argument to create_progress_broc and ci.coords.roc
when calling ci.coords.default or ci.coords.formula.
Argumentx,
Additionally, the list has the following attributes:boot.stratified=FALSE and the sample has a large imbalance between
cases and controls, it could happen that one or more of the replicates
contains no case or control observation, producing a NA area.
The warning boot.stratified=TRUE.ci.coords.formula and ci.coords.default are convenience methods
that build the ROC curve (with the roc function) before
calling ci.coords.roc. You can pass them arguments for both
roc and ci.coords.roc. Simply use ci.coords
that will dispatch to the correct method. This function creates boot.n bootstrap replicate of the ROC
curve, and evaluates the coordinates specified by the x, input,
ret, best.method and best.weights arguments. Then it computes the
confidence interval as the percentiles given by conf.level.
For more details about the bootstrap, see the Bootstrap section in this package's documentation.
Tom Fawcett (2006) ``An introduction to ROC analysis''. Pattern
Recognition Letters 27, 861--874. DOI:
roc,
coords,
ci
CRAN package data(aSAH)
# Syntax (response, predictor):
ci.coords(aSAH$outcome, aSAH$s100b, x="best")
# With a roc object:
rocobj <- roc(aSAH$outcome, aSAH$s100b)
ci.thresholds(rocobj, x="best")
# Customized bootstrap and specific thresholds:
ci.thresholds(aSAH$outcome, aSAH$s100b,
boot.n=500, conf.level=0.9, stratified=FALSE,
x=0.51)
# Alternatively, you can get the CI directly from roc():
rocobj <- roc(aSAH$outcome,
aSAH$s100b, ci=TRUE, of="coords", x="best")
rocobj$ciRun the code above in your browser using DataLab