add_metric {cutpointr}R Documentation

Add metrics to a cutpointr or roc_cutpointr object

Description

By default, the output of cutpointr includes the optimized metric and several other metrics. This function adds further metrics. Suitable metric functions are all metric functions that are included in the package or that comply with those standards.

Usage

add_metric(object, metric)

## S3 method for class 'cutpointr'
add_metric(object, metric)

## S3 method for class 'multi_cutpointr'
add_metric(object, metric)

## S3 method for class 'roc_cutpointr'
add_metric(object, metric)

Arguments

object

A cutpointr or roc_cutpointr object.

metric

(list) A list of metric functions to be added.

Value

A cutpointr or roc_cutpointr object (a data.frame) with one or more added columns.

See Also

Other main cutpointr functions: boot_ci(), boot_test(), cutpointr(), multi_cutpointr(), predict.cutpointr(), roc()

Examples

library(dplyr)
library(cutpointr)
cutpointr(suicide, dsi, suicide, gender) %>%
  add_metric(list(ppv, npv)) %>%
  select(optimal_cutpoint, subgroup, AUC, sum_sens_spec, ppv, npv)

[Package cutpointr version 1.1.2 Index]