plot.easy_tool: An S3 Method to Plot ROC Curves

View source: R/plot-methods.R

plot.easy_toolR Documentation

An S3 Method to Plot ROC Curves

Description

plot.easy_tool plots the k-fold cross-validated receiver-operating characteristics (ROC), including confidence intervals on the combinations of the local maxima of sensitivity and specificity.

Usage

## S3 method for class 'easy_tool'
plot(
  x,
  ...,
  plot_ci = TRUE,
  conf_level = 0.95,
  bootreps = 4000,
  print_auc = TRUE,
  partial_auc = c(0.8, 1),
  partial_auc_focus = c("sensitivity", "specificity"),
  partial_auc_correct = TRUE,
  type = c("l", "S")
)

Arguments

x

an object of class easy_tool.

...

any additional arguments passed to pROC::plot.roc or pROC::lines.roc.

plot_ci

(logical) plot confidence intervals if TRUE.

conf_level

confidence level

bootreps

the number of bootstrap replications for estimation of confidence intervals. Default: 4000.

print_auc

logical indicator for printing the area under the ROC curve (AUC) on the plot. Default: TRUE.

partial_auc

One of FALSE or a length two numeric vector of the form c(a, b) where a and b are the endpoints of the interval over which to compute the partial AUC (pAUC). Ignored if print_auc = FALSE. Default: c(0.8, 1).

partial_auc_focus

one of "sensitivity" or "specificity", indicating the measure for which the partial AUC is to be computed. Default: "specificity".

partial_auc_correct

logical indictor for transformation of the pAUC to fall within the range from 0.5 (random guess) to 1.0 (perfect classification). Default: TRUE.

type

type of plot; one of "l" (line) or "S" (stair-step). Default: "l".

Details

plot.easy_tool is an enhanced convenience wrapper for pROC::plot.roc.

Value

This function produces a plot as a side effect and (optionally) returns a dataframe containing sensitivities, specificities and their lower and upper confidence limits for threshold values of Pr(response = 1).

References

Fawcett T. An introduction to ROC analysis. Pattern Recognition Letters. 2006. 27(8):861-874. https://doi.org/10.1016/j.patrec.2005.10.010

Linden A. Measuring diagnostic and predictive accuracy in disease management: an introduction to receiver operating characteristic (ROC) analysis. Journal of Evaluation in Clinical Practice. 2006; 12(2):132-139. https://onlinelibrary.wiley.com/doi/epdf/10.1111/j.1365-2753.2005.00598.x

Robin X, Turck N, Hainard A, Tiberti N, Lisacek F, Sanchez J-C, Muller M. pROC: an open-source package for R and S+ to analyze and compare ROC curves. BMC Bioinformatics 2011; 12:77. https://www.biomedcentral.com/1471-2105/12/77

Examples

attach(uniobj1)
tool <- easy_tool(uniobj1, max = 3, crossval = TRUE)
plot(tool)

sgutreuter/screenr documentation built on Nov. 20, 2022, 2:41 a.m.