# Difference between mean and Kaplan-Meier estimate of mean

I have a panel dataset with individuals on a waiting list for a specific event. The individual can either: still be on the waiting list, have died on the waiting list, be withdrawn from the waiting list or the individual have experienced the event. The variable that measures time is called days and measures the number of days from being put on the waiting list until the individual is withdrawn from the waiting list for any of the reasons i just stated above.

If I calculate the mean (or median) for the variable days I get a different number from the Kaplan Meier estimated survival time. I suspect this has to do with how KM survival time estimate is calculated but can someone explain the difference?

Thanks!

The difference between the naive estimator and the KM is that the latter accounts for censoring: you know that a person still on the waiting list has survived at least up to time $$t$$, but you don't know when (if) they experience the event. Their data is not considered in the naive estimate but they do contribute meaningful information on the survival function. Alternatively you're counting their censoring time as the event time which is quite incorrect. Wikipedia already has a more rigorous explanation on this.
To try and explain the calculation of the KM estimator in more detail, you're essentially trying to form the survival function $$S(t)$$, the probability that someone will make it to time $$t$$ without experiencing the event. You can see this as a so-called 'life table', where for each time $$t$$ you count the number of subjects that still could experience an event (not already had one or censored) and divide the number of subjects that actually experienced an event between $$t-1$$ and $$t$$ by that denominator. You only really need to do this for $$t$$ where events are observed, because only then will the survival estimate change. The KM estimator up to time $$t$$ is then the product of all these proportions up to time $$t$$, where $$S(0)=1$$. Crucially, censored subjects do contribute to the denominators up to the last observed event prior to their censoring time.