# ci.thresholds(...)
"ci.thresholds"(roc, conf.level=0.95, boot.n=2000,
boot.stratified=TRUE, thresholds = "local maximas",
progress=getOption("pROCProgress")$name, parallel=FALSE, ...)
"ci.thresholds"(formula, data, ...)
"ci.thresholds"(smooth.roc, ...)
"ci.thresholds"(response, predictor, ...)roc function.roc function.roc function.
roc$thresholds) or a character all, local
maximas or best that will be used to determine the threshold(s)
on the supplied curve with coords (not on the resampled curves).
name argument to create_progress_bar for
more information), but a list as returned by create_progress_bar
is also accepted. See also the Progress bars section of
this package's documentation.
roc and ci.thresholds.roc
when calling ci.thresholds.default or ci.thresholds.formula.
Arguments for txtProgressBar (only
char and style) if applicable.
Arguments best.method and best.weights to coords.
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 NA value(s) produced during bootstrap were ignored.
will be issued and the observation will be ignored. If you have a large
imbalance in your sample, it could be safer to keep
boot.stratified=TRUE.ci.thresholds.formula and ci.thresholds.default are convenience methods
that build the ROC curve (with the roc function) before
calling ci.thresholds.roc. You can pass them arguments for both
roc and ci.thresholds.roc. Simply use ci.thresholds
that will dispatch to the correct method. This function creates boot.n bootstrap replicate of the ROC
curve, and evaluates the sensitivity and specificity at thresholds
given by the thresholds argument. Then it computes the
confidence interval as the percentiles given by conf.level.
A threshold given as a logical vector or character is converted to the corresponding numeric vector once
using the supplied ROC curve, and not at each bootstrap iteration. See ci.coords for the latter behaviour.
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: 10.1016/j.patrec.2005.10.010. Xavier Robin, Natacha Turck, Alexandre Hainard, et al. (2011) ``pROC: an open-source package for R and S+ to analyze and compare ROC curves''. BMC Bioinformatics, 7, 77. DOI: 10.1186/1471-2105-12-77. Hadley Wickham (2011) ``The Split-Apply-Combine Strategy for Data Analysis''. Journal of Statistical Software, 40, 1--29. URL: www.jstatsoft.org/v40/i01.
roc,
ci
CRAN package plyr, employed in this function.
data(aSAH)
## Not run:
# # Syntax (response, predictor):
# ci.thresholds(aSAH$outcome, aSAH$s100b)
#
# # With a roc object:
# rocobj <- roc(aSAH$outcome, aSAH$s100b)
# ci.thresholds(rocobj)
#
# # Customized bootstrap and specific thresholds:
# ci.thresholds(aSAH$outcome, aSAH$s100b,
# boot.n=500, conf.level=0.9, stratified=FALSE,
# thresholds=c(0.5, 1, 2))
# ## End(Not run)
# Alternatively, you can get the CI directly from roc():
rocobj <- roc(aSAH$outcome,
aSAH$s100b, ci=TRUE, of="thresholds")
rocobj$ci
# Plotting the CI
plot(rocobj)
plot(rocobj$ci)
Run the code above in your browser using DataLab