Learn R Programming

cutpointr (version 1.1.2)

oc_median: Use the sample median as cutpoint

Description

The sample median is calculated and returned as the optimal cutpoint.

Usage

oc_median(data, x, ...)

Arguments

data

A data frame or tibble in which the columns that are given in x and class can be found.

x

(character) The variable name to be used for classification, e.g. predictions or test values.

...

To capture further arguments that are always passed to the method function by cutpointr. The cutpointr function passes data, x, class, metric_func, direction, pos_class and neg_class to the method function.

See Also

Other method functions: maximize_boot_metric(), maximize_gam_metric(), maximize_loess_metric(), maximize_metric(), maximize_spline_metric(), oc_manual(), oc_mean(), oc_youden_kernel(), oc_youden_normal()

Examples

Run this code
# NOT RUN {
data(suicide)
oc_median(suicide, "dsi")
cutpointr(suicide, dsi, suicide, method = oc_median)
# }

Run the code above in your browser using DataLab