Learn R Programming

chest (version 0.3.7)

chest_cox: Assessing confounding effects using Cox Proportional Hazards regression models

Description

'chest_cox' is used to assess confounding effects using Proportional Hazards Regression Model ('coxph' from 'survival' package). It presents the effect estimates (such as hazard ratios) for the association between exposure and outcome variables by adding other variables (potential confounders) to the model sequentially. The order of variables to be added is based on the magnitudes of the changes in effect estimates.

Usage

chest_cox(
  crude,
  xlist,
  data,
  na_omit = TRUE,
  plus = "  + ",
  indicate = FALSE,
  ...
)

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 variable names of potential confounders.

data

Data frame.

na_omit

Remove all missing values, default: 'na_omit = TRUE'.

plus

Change the + sign before variable names.

indicate

indicate the progress.

...

Further optional arguments for forestplot.

See Also

'survival'

Examples

Run this code

vlist <- c("Age", "Sex", "Married", "Cancer", "CVD", "Education", "Income")

chest_cox(crude = "Surv(t0, t1, Endpoint) ~ Diabetes", xlist = vlist, data = diab_df)

Run the code above in your browser using DataLab