Current Code:
survfit(Surv(time, DEATH_EVENT) ~ 1, data = HF %>% filter(age <= 70)) %>%
tbl_survfit(
times = c(150,200),
label_header = "**150 Day survival (95% CI)**"
)
How can I add two separate titles to indicate survival times at 150 & 200?
The following code gives me an error:
survfit(Surv(time, DEATH_EVENT) ~ 1, data = HF %>% filter(age <= 70)) %>%
tbl_survfit(
times = c(150,200),
label_header = c("**150 Day survival (95% CI)**", "**200 Day survival (95% CI)**")
)
Error:
statistic=
andlabel_header=
arguments must be strings of length one.
CodePudding user response:
Take a look at the function's help file. The first example solves this issue: you need to use glue-syntax to dynamically insert the day number into the headers.