Useful when passing finalfit dependent and explanatory lists to base R functions

ff_formula(dependent, explanatory, random_effect = NULL)

finalfit_formula(dependent, explanatory, random_effect = NULL)

Arguments

dependent

Optional character vector: name(s) of depdendent variable(s).

explanatory

Optional character vector: name(s) of explanatory variable(s).

random_effect

Optional character vector: name(s) of random effect variable(s).

Value

Character vector

Examples

explanatory = c("age", "nodes", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "mort_5yr"
ff_formula(dependent, explanatory)
#> [1] "mort_5yr ~ age+nodes+sex.factor+obstruct.factor+perfor.factor"

explanatory = c("age", "nodes", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "mort_5yr"
random_effect = "(age.factor | hospital)"
ff_formula(dependent, explanatory)
#> [1] "mort_5yr ~ age+nodes+sex.factor+obstruct.factor+perfor.factor"