build_model_formula {basecamb}R Documentation

Build formula for statistical models

Description

Build formula used in statistical models from vectors of strings with the option to specify an environment.

Usage

build_model_formula(
  outcome,
  predictors,
  censor_event = NULL,
  env = parent.frame()
)

Arguments

outcome

character denoting the column with the outcome.

predictors

vector of characters denoting the columns with the predictors.

censor_event

character denoting the column with the censoring event, for use in Survival-type models.

env

environment to be used in formula creation

Value

formula for use in statistical models

Author(s)

J. Peter Marquardt

Examples

build_model_formula("outcome", c("pred_1", "pred_2"))
build_model_formula("outcome", c("pred_1", "pred_2"), censor_event = "cens_event")


[Package basecamb version 1.1.5 Index]