build_sequential_models {card} | R Documentation |
Model Building
Description
Simplify the process of building multiple models in a sequential order. This is particularly helpful in epidemiological cases of testing effect of additional parameters. Every parameter should be theoretically a part of the causal model for the exposure-outcome relationship.
Usage
build_sequential_models(formula, data, exposure = NULL, engine = "lm")
Arguments
formula |
an object of class |
data |
data frame or data table (or tibble) that contains the named variables |
exposure |
Variable that is forced to be maintained in every model as a predictor. |
engine |
Set the "engine" or the regression tool that will be used |
Details
This is considering what is available with the modelr
package and
the tidymodels
approach, and finding an in-between for the causality /
epidemiology approach of building intentional, sequentional models. Expect
changes in the process, and potential future dependencies on the
tidymodels
appraoches.
Value
A tidy tibble of models. Each one will likely be grouped by its outcome, and then with sequential columns using increased/additive models. Each model, in a tidy format, will have two additional columns.
-
outcomes
identifies which outcome was used for the specific regression -
covar
number of covariates used in sequence of predictors given, with exposure always being placed in position 1
Examples
data(geh)
f <- svg_mag + qrs_tang ~ lab_hba1c + bmi
build_sequential_models(f, data = geh)