Learn R Programming

basecamb (version 1.1.2)

build_model_formula: 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()
)

Value

formula for use in statistical models

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

Author

J. Peter Marquardt

Examples

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

Run the code above in your browser using DataLab