Skip to contents

This function constructs exposure-outcome models for each cohort using available exposure and outcome variables, and optionally available covariates.

Usage

dh.buildModels(avail_exp = NULL, avail_cov = NULL, avail_out = NULL)

Arguments

avail_exp

Output from dh.anyData detailing available exposures for each cohort.

avail_cov

Output from dh.anyData detailing available exposures for each cohort (optional).

avail_out

Output from dh.anyData detailing available outcomes for each cohort.

Value

A tibble containing four columns: (i) cohort, (ii) exposure, (iii) outcome, (iv) regression formula with these combinations. Optionally contains fifth column with list of covariates if avail_cov is not null.

Details

The function performs the following steps:

  1. Summarizes available exposure and outcome variables.

  2. Combines available exposure and outcome variables for all cohorts.

  3. Tidies up the combinations.

  4. If covariates are available, it splits combinations by cohort, adds covariates, and creates formulas.

  5. Returns the constructed models or formulas.