Multiple linear regression wrapper function that will take a list of exposure and outcome variables. Returns a matrix of results between each combination

lm_func(
  dependent_vars,
  independent_vars,
  data,
  covariates,
  include_sex = TRUE,
  include_cohort = TRUE,
  conf_level = 0.95
)

Arguments

dependent_vars

input a list of outcome variables

independent_vars

input a list of exposure variables

data

input a dataset tested with dataframe and tibble formats

covariates

input a list of confounders

include_sex

input either TRUE or FALSE to perform stratified analysis

include_cohort

input either TRUE or FALSE to perform stratified analysis

conf_level

input confidence interval level. Default to yield 95 percent Confidence interval

Value

This function will return a dataframe that will contain exposure, outcome, cohort level, sex level, regression coefficient, 95 percent confidence interval