build_model_formula: Build formula for statistical models

View source: R/Model_formula_tools.R

build_model_formulaR 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")


basecamb documentation built on May 29, 2024, 11:03 a.m.