build_cuts | R Documentation |
Transforms an ordinal variable into anywhere from two to five groups for cutpoint analysis.
build_cuts(x, n = c("b", "t", "qd", "qn"), var.prefix = NULL, list = FALSE)
x |
vector to split by certain cutpoints |
n |
either "b" for binarization (2 groups), "t" for trinarization (3 groups), "q" for quads (4 groups), or "qn" for quints (5 groups) |
var.prefix |
variable name prefix |
list |
if |
By default, a tibble of cutpoint variables built from a categorical
biomarker. The number of columns correspond to all the ways the biomarker
could be cut into n
bins. Each column name starts with a "b", "t",
"qd", or "qn" for "binarization", "trinarization", "quads", or "quints",
respectively, with the levels being compared separated by "v". If
list = FALSE
, each cutpoint variable is an element of a list.
Derek Chiu
set.seed(1108)
x <- sample(0:4, size = 1000, replace = TRUE)
build_cuts(x, n = "b")
build_cuts(x, n = "t")
build_cuts(x, n = "t", var.prefix = "PHGDH")
str(build_cuts(x, n = "qd", list = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.