create_model_formulas: Create model formulas

View source: R/create_model_formula.R

create_model_formulasR Documentation

Create model formulas

Description

Create model formulas

Usage

create_model_formulas(
  targets = outcomes,
  primary_covariate = primary,
  other_covariates = covariates,
  random_effects = "id_surgeon",
  interaction_term = NULL,
  mgcv = FALSE
)

Arguments

targets

character vector of target variable names

primary_covariate

character string of the key predictor variable

other_covariates

character vector of other predictors

random_effects

names of the random effect variables. Default is id_surgeon.

interaction_term

a character vector

mgcv

logical. Convert random effects specification to mgcv style? Default is false.

Value

a list of model formulas

Examples

create_model_formulas(
targets = c("severe_complication", "death_30d"),
primary_covariate = 's(surgeon_years_experience, k = 5)',
other_covariates = model_covariates,
random_effects = c(
  'procedure, surgeon_years_experience',
  'id_surgeon',
  'id_hospital',
  'cpt_cd'),
mgcv = F) # a glmm model for lme4

UMCSTaR/medicareAnalytics documentation built on July 13, 2022, 11:33 p.m.