data(sTRACE)
sTRACE$cluster <- sample(1:100, 500, replace = TRUE)
out1 <- km(Surv(time, status == 9) ~ strata(vf, chf), data = sTRACE)
out2 <- km(Surv(time, status == 9) ~ strata(vf, chf) + cluster(cluster), data = sTRACE)
summary(out1, times = 1:3)
summary(out2, times = 1:3)
par(mfrow = c(1, 2))
plot(out1, se = TRUE)
plot(out2, se = TRUE)
Run the code above in your browser using DataLab