chest_cox: Assessing confounding effects using Cox Proportional Hazards...

View source: R/chest_cox.R

chest_coxR Documentation

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,
  ...
)

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.

Value

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

See Also

'survival'

Examples


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

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

chest documentation built on March 31, 2023, 10:02 p.m.