Actually, it's worse than you think.
Ideal: if the survival curve has a horizontal segment at exactly 50%, report the midpoint of that segment.
For uncensored data, this makes the routine agree with the ordinary definition 
of a median.

Reality: The survfit routine tries for this. However, due to round-off error the horizontal segment that is at exactly .5 may be computed as .500000001 or .4999999999... In the first case you will get the right endpoint of the segment and in the second case the left endpoint.

There is nothing I can do to fix this. For uncensored data of size 100 the KM is 1, 99/100, (99/100) * (98/99), (99/100)*(98/99)*(97/98), .... Many of those fractions do not have an exact binary representation. Welcome to the world of floating point.

Terry T.

--- begin included message ---

Hi, if 50% survival probability horizontal line in a Kaplan-Meier survival curve overlap one of the step line between 2 time points t1 and t2, the survfit() from survival package estimates median survival as t2 (the longest time point). But I saw some articles (page 23: http://www.amstat.org/chapters/northeasternillinois/pastevents/presentations/summer05_Ibrahim_J.pdf) recommend the smallest time t such time S(t)<=0.5.?

What is the convention for the definition of median survival?

-- end inclusion ---

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to