# NOT RUN {
library(mets)
n <- 10;
d <- mets:::simCox(n); d$id <- seq(nrow(d)); d$group <- factor(rbinom(nrow(d),1,0.5))
m1 <- phreg(Surv(entry, time,status)~X1+X2+cluster(id)+strata(group),data=d)
riskRegression:::model.matrix(m1, d)
# }
Run the code above in your browser using DataLab