Dear List, Does anybody no how to compare mean survival times for two (more) groups in R? What test statistics should I use? Thank you very much! Joe [[alternative HTML version deleted]]
Xing Yuan <joe.yuan0309 <at> gmail.com> writes:> > Dear List, > > Does anybody no how to compare mean survival times for two (more) groups in > R? What test statistics should I use? > > Thank you very much! > > JoeThe question is probably a little bit too vague. You should certainly look at the survival package (which is 'recommended', so included with R) -- if you really have individual-level survival data, then survival analysis is more powerful than comparing mean survival times (but not necessarily the same thing). Try Therneau and Grambsch (listed on the "books" page at www.r-project.org) ... Ben Bolker
Hi, Xing Yuan wrote:> Dear List, > > Does anybody no how to compare mean survival times for two (more) groups in > R? What test statistics should I use?my answer is less of an R answer than a literature answer: John P. Klein and Melvin L. Moeschberger devote section 4.5 in their book "Survival Analysis" (Springer, starting on page 117 in the 2nd edition) to the topic: "Point and Interval Estimates of the Mean and Median Survival Time". I hope this helps, Roland
Xing Yuan wrote:> Dear List, > > Does anybody no how to compare mean survival times for two (more) groups in > R? What test statistics should I use?You should be careful considering the mean survival time, because censoring in survival data often makes the mean less informative. The median survival time is what is generally recommended for testing (i.e. in survdiff) and the statistical test of the median survival times following the methods in Harrington and Fleming (1982) Biometrika v.69 pp553-566. Corey Corey S. Sparks, Ph.D. Assistant Professor Department of Demography and Organization Studies University of Texas San Antonio One UTSA Circle San Antonio, TX 78249 email:corey.sparks@utsa.edu [[alternative HTML version deleted]]
Xing Yuan wrote:> Dear List, > > Does anybody no how to compare mean survival times for two (more) groups in > R? What test statistics should I use?Because of censoring, you can only compare the conditional means. That is, given a pre-defined cutpoint such as "2 years", you estimate the expected amount of the next 2 years that a person in each group will experience. For stability you need to have the cutpoint be smaller than the larger censoring times. (If no one has more than 2 years of fu, setting the cutpoint to 5 years is silly). The current survfit routine calculates the conditional mean and se() thereof for each curve. Unfortunately, it chooses the cutpoint per curve, as the largest time value in that curve. To make the numbers from two curves comparable, they need to have a common cutpoint. And, as Thomas L has pointed out to me, the cutpoint value should not be a value derived from the data, since the se calculation is under the assumption of a fixed cutpoint. This is easily done by preprocessing the data. (The cutpoint must be small enough so that every curve is "cut off" somewhat for this to work). newtime <- pmin(time, cutpoint) newstat <- ifelse(time<=cutpoint, status, 0) fit <- survfit(Surv(newtime, newstat) ~ group) print(fit, show.rmean=T) (This will be easier in the future, by giving a cutpoint to the print function). Since the curves are independent, the variance of the difference in means is the sum of the variances. Terry Therneau