Skip to contents

[Stable]

The survival fit is transformed in a grob containing a table with groups in rows characterized by N, median and 95% confidence interval.

Usage

h_grob_median_surv(
  fit_km,
  armval = "All",
  x = 0.9,
  y = 0.9,
  ttheme = gridExtra::ttheme_default()
)

Arguments

fit_km

(survfit)
result of survival::survfit().

armval

(string)
used as strata name when treatment arm variable only has one level. Default is "All".

x

a numeric value between 0 and 1 specifying x-location.

y

a numeric value between 0 and 1 specifying y-location.

ttheme

(list)
see gridExtra::ttheme_default().

Examples

if (FALSE) {
library(scda)
library(dplyr)
library(survival)
library(grid)

grid::grid.newpage()
grid.rect(gp = grid::gpar(lty = 1, col = "pink", fill = "gray85", lwd = 1))
synthetic_cdisc_data("latest")$adtte %>%
  filter(PARAMCD == "OS") %>%
  survfit(form = Surv(AVAL, 1 - CNSR) ~ ARMCD, data = .) %>%
  h_grob_median_surv() %>%
  grid::grid.draw()
}