all_cox {allestimates} | R Documentation |
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, ...)
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 |
... |
Further optional arguments. |
A list of all effect estimates.
surival
vlist <- c("Age", "Sex", "Married", "BMI", "Education", "Income")
results <- all_cox(crude = "Surv(t0, t1, Endpoint) ~ Diabetes", xlist = vlist, data = diab_df)
results