Learn R Programming

cutpointr (version 0.7.3)

multi_cutpointr: Calculate optimal cutpoints and further statistics for multiple predictors

Description

Runs cutpointr_ over multiple predictor variables. By default, cutpointr_ will be run using all columns in the data set as predictors except for the variable in class.

Usage

multi_cutpointr(data, x = colnames(data)[colnames(data) != class], class,
  silent = FALSE, ...)

Arguments

data

A data frame.

x

Character vector of predictor variables.

class

The name of the outcome / independent variable.

silent

Whether to suppress messages.

...

Further arguments to be passed to cutpointr.

Value

A data frame.

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.

See Also

Other main cutpointr functions: cutpointr_, cutpointr, predict.cutpointr, roc

Examples

Run this code
# NOT RUN {
library(cutpointr)

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

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

# }

Run the code above in your browser using DataLab