1

假设我有以下数据框

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))

如何执行多重比较测试比较例如 group0 与所有其他组?还是每组都在一起?

有没有一种很好的方法来绘制这些多重比较(例如plot.TukeyHSD()aov()?

4

1 回答 1

1

multcomp 的generalsiminf.pdf 中有一个例子。在这里简化

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")))
于 2012-06-25T06:47:30.497 回答