get_COX_HR | R Documentation |
S3 method for extracting information regarding Hazard Ratios. The function allows the survival object's formula to be updated. No default method is available at the moment.
get_COX_HR(x, ...)
## S3 method for class 'survfit'
get_COX_HR(x, update_formula = NULL, ...)
x |
An object of class |
... |
other arguments passed on to the method survival::coxph |
update_formula |
Template which specifies how to update the formula of the survfit object |
A tidied object of class coxph
containing Hazard Ratios
coxph
update.formula
## treatment effect
survfit_object_trt <- visR::estimate_KM(data = adtte, strata = c("TRTP"))
visR::get_COX_HR(survfit_object_trt)
## treatment and gender effect
survfit_object_trt_sex <- visR::estimate_KM(data = adtte, strata = c("TRTP", "SEX"))
visR::get_COX_HR(survfit_object_trt_sex)
## update formula of KM estimates by treatment to include "SEX" for HR estimation
visR::get_COX_HR(survfit_object_trt, update_formula = ". ~ . + SEX")
## update formula of KM estimates by treatment to include "AGE" for
## HR estimation with ties considered via the efron method
visR::get_COX_HR(survfit_object_trt,
update_formula = ". ~ . + survival::strata(AGE)", ties = "efron"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.