ECII
ECII

Reputation: 10619

Kaplan-Meier multiple group comparisons

Lets say I have the following data frame

library(survival)
library(multcomp)
data(cml)
cml$group<-sample(1:5, 507, replace=T)
plot(survfit(Surv(time=cml$time, cml$status)~cml$group))
(survdiff(Surv(time=cml$time, cml$status)~cml$group))

How can I perform multiple comparison test comparing for example group0 vs. all other groups? Or every group with each other?

Is there a nice way of plotting these multiple comparisons (as for example in plot.TukeyHSD() in aov()?

Upvotes: 1

Views: 4078

Answers (1)

Dieter Menne
Dieter Menne

Reputation: 10215

There is an example in the generalsiminf.pdf of multcomp. Simplified here

library(multcomp)
library(survival)
if (!file.exists("AML_Bullinger.rda"))
  load(url("http://www.stat.uni-muenchen.de/~hothorn/data/AML_Bullinger.rda", open = "r"))
risk <- rep(0, nrow(clinical))
rlev <- levels(clinical[, "Cytogenetic.group"])
risk[clinical[, "Cytogenetic.group"] %in% rlev[c(7,8,4)]] <- "low"
risk[clinical[, "Cytogenetic.group"] %in% rlev[c(5, 9)]] <- "intermediate"
risk[clinical[, "Cytogenetic.group"] %in% rlev[-c(4,5, 7,8,9)]] <- "high"
risk <- as.factor(risk)
names(clinical)[6] <- "FLT3"
save(clinical,file="AML_Bullinger.rda")
smod <- survreg(Surv(time, event) ~ Sex + Age + WBC+risk,
                 data = clinical)
summary(glht(smod, linfct = mcp(risk = "Tukey")))

Upvotes: 1

Related Questions