I have two separate survival Kaplan-Myer curve. I wonder how I can get the p value of the difference between these two survival curve. survdiff
or survminer::surv_pvalue
only work if there is a predictor like sex, adhere etc.
library(survival)
library(survminer)
fit1 <- surv_fit(Surv(time, status) ~ 1, data = colon)
colon.male = colon[colon$sex==1, ]
fit2 <- surv_fit(Surv(time, status) ~ 1, data = colon.male)