Learn R Programming

allestimates (version 0.2.3)

all_cox: Estimates all possible effect estimates using Cox Proportional Hazards regression models

Description

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

Usage

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

Value

A list of all effect estimates.

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.

See Also

surival

Examples

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

Run the code above in your browser using DataLab