0

I want to calculate the overall survival of two cohorts. "dat" is the dataframe containing the data. The follow-up time of the patients is recorded in "follow_up_TIME" and "EXITUS" is a categorical variable where 0 = alive and 1 = death. I need to check if there are differences in the survival between the two cohorts, as well as calculate the survival probability at 12 and 56 months and see if there are differences between the two cohorts. I'm planning to use this code:

model_OS <- survfit(Surv(dat$follow_up_TIME,dat$EXITUS)~ dat$Cohorte) 

ggsurvplot(model_OS, data = dat,
           legend.title = "Overall survival",
           legend.labs = c("Cohort1", "Cohort2"),
           xlab = "Time (months)", 
           ylab = "Overall Survival probability",
           pval = TRUE,
           conf.int = FALSE, 
           risk.table = TRUE,
           tables.height = 0.2,
           tables.theme = theme_cleantable(),
           palette = c("black", "red"),
           ggtheme = theme_bw() # Change ggplot2 theme
)

summary(model_OS, times = 12)

I also have "EXITUS_12y" (whether the patient died or not in 1 year) and "EXITUS_5y" (whether the patient died or not in 2 years). Which variables should I use to create the graphs? And how can I obtain the p-values?

Thank you very much for your help ;)

EI_Stats
  • 21
  • 2

0 Answers0