'chest_lm'
is used to assess confounding effects using Linear Regression Models.
It presents linear regression coefficients as effect estimates and
changes when other variables are added sequentially to the model.
chest_lm(
crude,
xlist,
data,
method = "qr",
na_omit = TRUE,
indicate = FALSE,
plus = " + ",
...
)
A table with effect estimates and their changes at all steps.
An object of formula for initial model, generally crude model. However, any other variables can also be included here as the initial model.
A vector of characters with all variable names of potential confounders.
Data frame.
The method to be used; see 'lm'.
Remove all missing values.
indicate progress
Change the +
sign before variable names.
Further optional arguments.
'lm'
of 'stats'
vlist <- c("Age", "Sex", "Married", "Cancer", "CVD", "Education", "Income")
chest_lm(crude = "BMI ~ Diabetes", xlist = vlist, data = diab_df, na_omit = TRUE)
Run the code above in your browser using DataLab