ci(pROC)Spotfire S+ Documentation

Compute the confidence interval of a ROC curve

Description

This function computes the confidence interval (CI) of a ROC curve. The of argument controls the type of CI that will be computed. By default, the 95% CI are computed with 2000 stratified bootstrap replicates.

Usage

ci(x, ...)
## S3 method for class 'roc':
ci(roc, of = c("auc", "thresholds", "sp", "se"), ...)
## S3 method for class 'smooth.roc':
ci(smooth.roc, of = c("auc", "sp", "se"), ...)
## S3 method for class 'formula':
ci(formula, data, ...)
## Default S3 method:
ci(response, predictor, ...)

Arguments

x a roc object from the roc function (for ci.roc), a formula (for ci.formula) or a response vector (for ci.default).
roc, smooth.roc a “roc” object from the roc function, or a “smooth.roc” object from the smooth.roc function.
response, predictor arguments for the roc function.
formula, data a formula (and possibly a data object) of type response~predictor for the roc function.
of The type of confidence interval. One of “auc”, “thresholds”, “sp” or “se”. Note that confidence interval on “thresholds” are not available for smoothed ROC curves.
... further arguments passed to or from other methods, especially auc, roc, and the specific ci functions ci.auc, ci.se, ci.sp and ci.thresholds.

Details

ci.formula and ci.default are convenience methods that build the ROC curve (with the roc function) before calling ci.roc. You can pass them arguments for both roc and ci.roc. Simply use ci that will dispatch to the correct method.

This function is typically called from roc when ci=TRUE (not by default). Depending on the of argument, the specific ci functions ci.auc, ci.thresholds, ci.sp or ci.se are called.

Value

The return value of the specific ci functions ci.auc, ci.thresholds, ci.sp or ci.se, depending on the of argument.

References

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.

See Also

roc, auc, ci.auc, ci.thresholds, ci.sp, ci.se

Examples

data(aSAH)

# Syntax (response, predictor):
ci(aSAH$outcome, aSAH$s100b)

# With a roc object:
rocobj <- roc(aSAH$outcome, aSAH$s100b)

# Of an AUC 
ci(rocobj)
ci(rocobj, of="auc")
# this is strictly equivalent to:
ci.auc(rocobj)

# Of thresholds, sp, se...
## Not run: 
ci(rocobj, of="thresholds")
ci(rocobj, of="thresholds", thresholds=0.51)
ci(rocobj, of="thresholds", thresholds="all")
ci(rocobj, of="sp", sensitivities=c(.95, .9, .85))
ci(rocobj, of="se")
## End(Not run)

# Alternatively, you can get the CI directly from roc():
rocobj <- roc(aSAH$outcome, aSAH$s100b, ci=TRUE, of="auc")
rocobj$ci


[Package pROC version 1.4.9 Index]