add_dummy: Additional Predictor as logical

View source: R/add_dummy.R

add_dummyR Documentation

Additional Predictor as logical

Description

Additional predictor as logical.

Usage

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()),
  ...
)

Arguments

start.model

a regression model, e.g., lm, glm, or coxph, etc.

x

one-sided formula, numeric predictors x's as the columns of one matrix column in data

data

(optional) data.frame in the model call of start.model

times, ...

additional parameters of function statusPartition() for function add_dummy_partition. For function add_dummy(), these parameters are not in use

mc.cores

integer scalar, see function mclapply

Details

Function add_dummy_partition() partitions each additional numeric predictor into a logical variable in the following steps.

  1. Generate multiple, i.e., repeated, partitions via functions createDataPartition or statusPartition().

  2. 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.

  3. 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.

Value

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.


maxEff documentation built on April 12, 2025, 2:11 a.m.