This is more of a general question without data. After doing 'survdiff', from the 'survival' package, on strata including four groups (so 4 curves on a Kaplan Meier curve) you get a chi squared p-value whether to reject the null hypothesis or not. Is there a method to followup with pairwise testing on the respective groups? I have searched the library but have come up with nothing. Perhaps I am mistaken in something here. Regards, Charles [[alternative HTML version deleted]]
On Oct 24, 2012, at 4:33 PM, Charles Determan Jr <deter088 at umn.edu> wrote:> This is more of a general question without data. After doing 'survdiff', > from the 'survival' package, on strata including four groups (so 4 curves > on a Kaplan Meier curve) you get a chi squared p-value whether to reject > the null hypothesis or not. Is there a method to followup with pairwise > testing on the respective groups? I have searched the library but have > come up with nothing. Perhaps I am mistaken in something here. > > Regards, > CharlesTake a look at ?p.adjust, which provides a generic framework for multiple pairwise comparison adjustment methods. The most conservative, but not always the best approach, would of course be Bonferroni. Regards, Marc Schwartz
No, you didn't miss anything in the survival package. I've never found post-hoc tests interesting so have little motivation to add such (and a very long "to do" list of things I would like to add). If you simply must have them, why not do all pairwise tests? chisq <- matrix(0., 4,4) for (i in 1:4) { for (j in (1:4)[-i]) { temp <- survdiff(Surv(time, status) ~ group, data=mydata, subset=(group %in% (unique(group))[c(i,j)])) chisq[i,j] <- temp$chisq } } Terry Therneau On 10/25/2012 05:00 AM, r-help-request at r-project.org wrote:> This is more of a general question without data. After doing 'survdiff', > from the 'survival' package, on strata including four groups (so 4 curves > on a Kaplan Meier curve) you get a chi squared p-value whether to reject > the null hypothesis or not. Is there a method to followup with pairwise > testing on the respective groups? I have searched the library but have > come up with nothing. Perhaps I am mistaken in something here.