Description Usage Arguments Value Author(s) See Also Examples
S3 method for extracting information regarding Hazard Ratios. No default method is available at the moment.
1 2 3 4 | get_COX_HR(x, ...)
## S3 method for class 'survfit'
get_COX_HR(survfit_object = survfit_object, update_formula = NULL, ...)
|
x |
S3 object |
... |
other arguments passed on to the method survival::coxph |
survfit_object |
An object of class |
update_formula |
Template which specifies how to update the formula of the survfit_object |
A tibble with Hazard Ratios
Steven Haesendonckx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(survival)
library(dplyr)
library(tidyr)
library(ggplot2)
## treatment effect
survfit_object_trt <- vr_KM_est(data = adtte, strata = c("TRTP"))
get_COX_HR(survfit_object_trt)
## treatment and gender effect
survfit_object_trt_sex <- vr_KM_est(data = adtte, strata = c("TRTP", "SEX"))
get_COX_HR(survfit_object_trt_sex)
## update formula of KM estimates by treatment to include "SEX" for HR estimation
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
get_COX_HR(survfit_object_trt, update_formula = ". ~ . + strata(AGE)", ties = "efron")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.