I have been trying to find a way to get p-value for 6 months, 12 months and 5 years.
library(survival) fit <- survfit(Surv(futime, fustat) ~ rx,data=ovarian) surv_pvalue(fit)$pval.txt
This produces:  "p = 0.3"
I would like the p-value however, to only reference a certain time period.
fittime <- summary(fit,times=c(182.5)) surv_pvalue(fittime)$pval.txt
This also produces:  "p = 0.3"
The number remains the same no matter what time I try to use. I also tried it with different data where the curves are similar in the beginning yet completely different after a certain time, yet receive the same results.
Any suggestions on how I would go about getting a 'p-value' for a certain time period ?