all_cox function

Estimates all possible effect estimates using Cox Proportional Hazards regression models

Estimates all possible effect estimates using Cox Proportional Hazards regression models

Estimates hazard ratios using Proportional Hazards Regression models ("coxph" from survival package) from models with all possible combinations of a list of variables.

all_cox(crude, xlist, data, na_omit = TRUE, ...)

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. The left-hand side of ~ is the outcome of interest, and the variable on the right-hand side of ~ is the exposure of the interest (either a treatment or a risk factor)
  • xlist: A vector of a list of variable names.
  • data: Data frame.
  • na_omit: Remove all missing values. Default is "na_omit = TRUE".
  • ...: Further optional arguments.

Returns

A list of all effect estimates.

Examples

vlist <- c("Age", "Sex", "Married", "BMI", "Education", "Income") results <- all_cox(crude = "Surv(t0, t1, Endpoint) ~ Diabetes", xlist = vlist, data = diab_df) results

See Also

surival

  • Maintainer: Zhiqiang Wang
  • License: GPL-2
  • Last published: 2023-03-26

Useful links