add_dummy | R Documentation |
Additional predictor as logical.
add_dummy_partition(
start.model,
x,
data = eval(start.model$call$data),
times,
mc.cores = switch(.Platform$OS.type, windows = 1L, detectCores()),
...
)
add_dummy(
start.model,
x,
data = eval(start.model$call$data),
mc.cores = switch(.Platform$OS.type, windows = 1L, detectCores()),
...
)
start.model |
a regression model, e.g., lm, glm, or coxph, etc. |
x |
one-sided formula,
numeric predictors |
data |
(optional) data.frame in the model call of |
times , ... |
additional parameters of function |
mc.cores |
integer scalar, see function mclapply |
Function add_dummy_partition()
partitions each additional numeric predictor
into a logical variable in the following steps.
Generate multiple, i.e., repeated, partitions via functions createDataPartition or statusPartition()
.
For each partition, create a dichotomizing rule (via function node1()
) on the training set.
Apply this dichotomizing rule on the test set and obtain the estimated regression coefficient (i.e., effect size)
of the additional logical predictor.
Among all partitions, select the one with median effect size of the additional logical predictor.
Function add_dummy()
partitions each additional
numeric predictor into a logical variable
using function node1()
,
then updates the starting model by adding in each of the dichotomized
logical predictor.
Function add_dummy_partition()
returns an object of class 'add_dummy'
, which is a listof node1 objects.
Function add_dummy()
returns an object of class 'add_dummy'
,
which is a listof node1 objects.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.