multi_cutpointr {cutpointr} | R Documentation |
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
.
multi_cutpointr(data, x = NULL, class, subgroup = NULL, silent = FALSE, ...)
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_ (Use a quoted variable name for subgroup). |
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.
A data frame.
Other main cutpointr functions:
add_metric()
,
boot_ci()
,
boot_test()
,
cutpointr()
,
predict.cutpointr()
,
roc()
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)