[R] Convert results from print(survfit(formula, ...)) into a matrix or data frame

Paul Miller pjmiller_57 at yahoo.com
Mon Apr 15 18:31:27 CEST 2013


Hello All,

Below is some sample survival analysis code. I'd like to able to get the results from print(gehan.surv) into a matrix or data frame, so I can manipulate them and then create a table using odfWeave. Trouble is, I'm not quite sure how make such a conversion using the results from a print method.

Is there some simple way of doing this?

Thanks,

Paul

require(survival)
require(MASS)

attach(gehan)
gehan.surv <- survfit(Surv(time, cens) ~ treat, data= gehan, conf.type = "log-log")
print(gehan.surv)



More information about the R-help mailing list