If there is no censoring, can be the naive 3rd quantile different from the one calculated with from the Kaplan-Meier

kaplan-meiermediansurvival

I know, that the median survival time calculated from the Kaplan-Meier estimator is equal to the "naive" descriptive median of the survival time when no censoring in data occurs.

Does it apply also to the other quantiles, like the 3rd quantile? Is this possible that they differ, if no censoring occurs and all subjects experience the event?

> quantile(d$time)
     0%     25%     50%     75%    100% 
 2.5000  3.1375  4.3050 11.3700 71.4200 

> km  <- survfit( Surv(time, event) ~ 1, data = d, conf.type = "log-log")
> 
> quantile(km)
$quantile
    25     50     75 
 3.120  4.305 12.140 

No censoring:

> d %>% count(event)
  event  n
1     1 86

EDIT:
OK, got it, thanks to @Frank Harrell

I should use the empirical CDF with averaging at discontinuities:

> quantile(km)$quantile
    25     50     75 
 3.120  4.305 12.140 

> quantile(d$time, type=2)
    0%    25%    50%    75%   100% 
 2.500  3.120  4.305 12.140 71.420 

Best Answer

There are multiple definitions of sample (and population, in case of discreteness) quantiles. If you use the empirical cumulative distribution function definition (which is not a weighted average of two estimates) this agrees fully with Kaplan-Meier under no censoring, because K-M is precisely one minus the empirical cumulative distribution function. Note that sample quantiles are noisy estimates --- even more so with censoring which lowers the effective sample size.

Related Question