View source: R/Cox_estimation_helpers.R
| fit_cox_models | R Documentation |
Fits Cox models for two subgroups defined by treatment recommendation.
fit_cox_models(df, formula, treat.name = NULL)
df |
Data frame. |
formula |
Cox model formula. |
treat.name |
Character or |
List with HR and SE for each subgroup.
## Not run:
library(survival)
df <- data.frame(
tte = gbsg$rfstime / 30.4375,
event = gbsg$status,
treat = gbsg$hormon,
treat.recommend = as.integer(gbsg$er > 0)
)
formula <- build_cox_formula("tte", "event", "treat")
fit_cox_models(df, formula)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.