Re: [R] Obtaining value of median survival for survfit function to use in calculation

2009-09-08 Thread Frank E Harrell Jr
Or try the following: require(rms) data(lung) survfit(Surv (time, status) ~ ph.ecog, data=lung) lung <- transform(lung, ph.ecog=factor(ph.ecog)) f <- cph(Surv(time, status) ~ strat(ph.ecog), data=lung, surv=TRUE) ## doesn't assume PH quant <- Quantile(f) # print quant to see how all quantiles a

Re: [R] Obtaining value of median survival for survfit function to use in calculation

2009-09-08 Thread Marc Schwartz
Hi, I have a strong recollection of a relatively recent communication on this issue with Terry, but cannot seem to locate it at the moment and I don't recall if it was on-list or off-list. I am either on drugs or Terry indicated that he was going to modify either the returned survfit() or

Re: [R] Obtaining value of median survival for survfit function to use in calculation

2009-09-08 Thread David Winsemius
The survfit.object help page says: "The print.survfit method does more computation than is typical for a print method and is documented on a separate page." It takes a bit of digging, but after first trying: getAnywhere(print.survfit) # and then following code and trying getAnywhere(survme

[R] Obtaining value of median survival for survfit function to use in calculation

2009-09-08 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Hi, I'm sure this should be simple but I can't figure it out! I want to get the median survival calculated by the survfit function and use the value rather than just be able to print it. Something like this: library(survival) data(lung) lung.byPS = survfit(Surv (time, status) ~ ph.ecog, data=