build_sequential_models: Model Building

Description Usage Arguments Details Value Examples

View source: R/hrv_modeling.R

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

1
build_sequential_models(formula, data, exposure = NULL, engine = "lm")

Arguments

formula

an object of class formula that shows the names of the outcomes (can be more than 1) and the names of the predictors (which should contain the exposure variable).

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.

Examples

1
2
3
data(geh)
f <- svg_mag + qrs_tang ~ lab_hba1c + bmi
build_sequential_models(f, data = geh)

card documentation built on Sept. 3, 2020, 9:07 a.m.