## See tests directory test.Rnw for a live example
set.seed(1)
n <- 400
dat <- data.frame(t1=runif(n, 2, 5), t2=runif(n, 2, 5),
e1=rbinom(n, 1, .5), e2=rbinom(n, 1, .5),
treat=sample(c('a','b','c'), n, TRUE))
dat <- upData(dat,
labels=c(t1='Time to operation',
t2='Time to rehospitalization',
e1='Operation', e2='Hospitalization',
treat='Treatment')
units=c(t1='year', t2='year'))
survReport(Srv(t1, e1) + Srv(t2, e2) ~ treat, data=dat)Run the code above in your browser using DataLab