get_COX_HR: Summarize Hazard Ratio from a survival object using S3 method

Description Usage Arguments Value Author(s) See Also Examples

View source: R/get_COX_HR.R

Description

S3 method for extracting information regarding Hazard Ratios. No default method is available at the moment.

Usage

1
2
3
4
get_COX_HR(x, ...)

## S3 method for class 'survfit'
get_COX_HR(survfit_object = survfit_object, update_formula = NULL, ...)

Arguments

x

S3 object

...

other arguments passed on to the method survival::coxph

survfit_object

An object of class survfit

update_formula

Template which specifies how to update the formula of the survfit_object update.formula

Value

A tibble with Hazard Ratios

Author(s)

Steven Haesendonckx

See Also

coxph update.formula

Examples

 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")

visR-sandbox/visR-survival documentation built on Sept. 18, 2020, 6:21 p.m.