multi_cutpointr: Calculate optimal cutpoints and further statistics for...

View source: R/cutpointr.R

multi_cutpointrR Documentation

Calculate optimal cutpoints and further statistics for multiple predictors

Description

Runs cutpointr over multiple predictor variables. Tidyeval via !! is supported for class and subgroup. If x = NULL, cutpointr will be run using all numeric columns in the data set as predictors except for the variable in class and, if given, subgroup.

Usage

multi_cutpointr(data, x = NULL, class, subgroup = NULL, silent = FALSE, ...)

Arguments

data

A data frame.

x

Character vector of predictor variables. If NULL all numeric columns.

class

The name of the outcome / independent variable.

subgroup

An additional covariate that identifies subgroups. Separate optimal cutpoints will be determined per group.

silent

Whether to suppress messages.

...

Further arguments to be passed to cutpointr, e.g., boot_runs

Details

The automatic determination of positive / negative classes and direction will be carried out separately for every predictor variable. That way, if direction and the classes are not specified, the reported AUC for every variable will be >= 0.5. AUC may be < 0.5 if subgroups are specified as direction is equal within every subgroup.

Value

A data frame.

See Also

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

Examples

library(cutpointr)

multi_cutpointr(suicide, x = c("age", "dsi"), class = suicide,
                pos_class = "yes")

mcp <- multi_cutpointr(suicide, x = c("age", "dsi"), class = suicide,
                       subgroup = gender, pos_class = "yes")
mcp

(scp <- summary(mcp))
## Not run: 
## The result is a data frame
tibble:::print.tbl(scp)

## End(Not run)


cutpointr documentation built on April 14, 2022, 1:06 a.m.