plot_roc {cutpointr}R Documentation

Plot ROC curve from a cutpointr or roc_cutpointr object

Description

Given a cutpointr object this function plots the ROC curve(s) per subgroup, if given. Also plots a ROC curve from the output of roc().

Usage

plot_roc(x, ...)

## S3 method for class 'cutpointr'
plot_roc(x, display_cutpoint = TRUE, type = "line", ...)

## S3 method for class 'roc_cutpointr'
plot_roc(x, type = "line", ...)

Arguments

x

A cutpointr or roc_cutpointr object.

...

Additional arguments (unused).

display_cutpoint

(logical) Whether or not to display the optimal cutpoint as a dot on the ROC curve for cutpointr objects.

type

"line" for line plot (default) or "step" for step plot.

See Also

Other cutpointr plotting functions: plot.cutpointr(), plot_cut_boot(), plot_cutpointr(), plot_metric_boot(), plot_metric(), plot_precision_recall(), plot_sensitivity_specificity(), plot_x()

Examples

opt_cut <- cutpointr(suicide, dsi, suicide)
plot_roc(opt_cut, display_cutpoint = FALSE)

opt_cut_2groups <- cutpointr(suicide, dsi, suicide, gender)
plot_roc(opt_cut_2groups, display_cutpoint = TRUE)

roc_curve <- roc(suicide, x = dsi, class = suicide, pos_class = "yes",
  neg_class = "no", direction = ">=")
plot(roc_curve)
auc(roc_curve)

[Package cutpointr version 1.1.2 Index]