Description Usage Arguments Value
Converts a continuous variable to a binary one. Zero or negative values of the continuous variable will be considered to have the first level of the variable.
1 2 3 4 5 6 7 | convert.continuous.to.binary(
data.dt,
max.chance = 0.5,
var.levels = c(0, 1),
delete.outcome.orig = T,
delete.prob = T
)
|
data.dt |
data.table with minimally participant ID and outcome. |
max.chance |
The chance that the highest value of the continuous variable will be assigned the second level of the binary variable. (Default: 0.5) |
var.levels |
Vector containing the values that the binary outcome will assume (Default: c(0,1)) |
delete.outcome.orig |
Delete original continuous outcome (Default: TRUE) |
delete.prob |
Delete calculated probability of var.levels[2] (Default: TRUE) |
A data.table with the continuous outcome column replaced by the specified binary variable. Not necessary to use return value, as data.dt will be modified by reference,
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.