Skip to content

Conversation

DanChaltiel
Copy link
Member

Le but principal est d'avoir OS, PFS, et EFS (par exemple) sur un même graphique de KM.

Comme pharmaverse/ggsurvfit#212 ne sera pas implémenté, on va intégrer ça dans grstat.

Exemple :

set.seed(42)
df_surv = survival::lung %>%
  as_tibble() %>%
  mutate(
    time_os = time,
    event_os = status == 2,
    time_pfs = time / (1 + runif(n())),
    event_pfs = ifelse(runif(n()) > 0.3, event_os, 1),
    time_efs = time_pfs / (1 + runif(n())),
    event_efs = ifelse(runif(n()) > 0.3, event_pfs, 1)
  )

surv_list = list(
  "Overall survival" = c("time_os", "event_os"),
  "Progression-free survival" = c("time_pfs", "event_pfs"),
  "Event-free survival" = c("time_efs", "event_efs")
)

survfit_stack(df_surv, surv_list=surv_list) %>%
  ggsurvfit() +
  add_confidence_interval() +
  add_risktable() +
  scale_ggsurvfit()
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants