Learn R Programming

chest (version 0.3.7)

chest_lm: Assessing confounding effects using Linear regression models

Description

'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.

Usage

chest_lm(
  crude,
  xlist,
  data,
  method = "qr",
  na_omit = TRUE,
  indicate = FALSE,
  plus = "  + ",
  ...
)

Value

A table with effect estimates and their changes at all steps.

Arguments

crude

An object of formula for initial model, generally crude model. However, any other variables can also be included here as the initial model.

xlist

A vector of characters with all variable names of potential confounders.

data

Data frame.

method

The method to be used; see 'lm'.

na_omit

Remove all missing values.

indicate

indicate progress

plus

Change the + sign before variable names.

...

Further optional arguments.

See Also

'lm' of 'stats'

Examples

Run this code
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