plot.simple_screenr: An S3 Method to Plot ROC Curves

View source: R/plot-methods.R

plot.simple_screenrR Documentation

An S3 Method to Plot ROC Curves

Description

plot.simple_screenr plots the k-fold cross-validated receiver-operating characteristic, including confidence intervals on the combinations of the local maxima of sensitivity and specificity.

Plot ROC curve with pointwise 95 intevals on sensitivity and specificity and (optionally) returns a dataframe containing numerical values.

Usage

## S3 method for class 'simple_screenr'
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,
  reuse_auc = FALSE,
  type = c("l", "S"),
  lty = 1
)

Arguments

x

an object of class simple_screenr.

...

additional arguments for ⁠\link{plot}⁠ or passed to ⁠\link{plot.roc}⁠ and friends.

plot_ci

logical indicator for plotting point-wise confidence intervals at the locally maximum subset of coordinates for on sensitivity and specificity. Default: ⁠TRUE⁠. See also ci.thresholds.

conf_level

confidence level in the interval (0,1). Default is 0.95 producing 95% confidence intervals. Default: ⁠TRUE⁠.

bootreps

numeric-valued number of bootstrap replication for estimation of 95% 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 out-of-sample 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 out-of-sample 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⁠.

reuse_auc

if FALSE (default) do not re-use any AUC specifications that might be contained in the roc-class object.

type

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

lty

line type of plot; see base plot. Default: ⁠"1"⁠.

Value

This function produces a plot as a side effect, and (optionally) returns a dataframe dataframe containing medians and bootstrap confidence limits of sensitivity and specificity.

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

data(unicorns)
too_simple <- simple_screenr(testresult ~ Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7,
                          data = unicorns)
plot(too_simple)

sgutreuter/screenr documentation built on Oct. 19, 2024, 12:49 p.m.