I am using the survival package for a population with two subgroups. I need the 5 year KM survival percentage for each group. I got this value from:
summary(survfit(Surv(survtime, vital)~subgroup)), time = 60) #in months
However, I also wanted to run a chisq test on the two five year survival rates. Is there an easy way to run this test using the survival package?
Thank you for any advice and help!
Not sure if this is the right way to go about it (buyer beware), but here is an example using the
amldataset included as example data with thesurvivalpackage.Which results in, for
time=20:Both of these options fail using the
survdifffunction:Now try limiting to 20 days manually:
Now you can get your results for the 20 days limit comparing the two groups: