# NOT RUN {
# use example from coxph() in library 'survival'
test1 <- list(time = c(4, 3, 1, 1, 2, 2, 3),
status = c(1, 1, 1, 0, 1, 1, 0),
x = c(0, 2, 1, 1, 1, 0, 0),
sex = c(0, 0, 0, 0, 1, 1, 1))
# fit a coxph() model
mod1 <- coxph(Surv(time, status) ~ x + sex, data = test1)
# generate table to insert in Sweave file
m1 <- displayCoxPH(mod1)
# }
Run the code above in your browser using DataLab