How to use the kaplan-meier estimator
- Type one line per item as time, status. Use 1 (or the word event) when the event happened and 0 (or censored) when the item was last seen without it.
- Choose a confidence level for the interval around each survival value.
- Read the median survival time and the table. Survival drops only at times with an event; times with only censored items change the number at risk but not the survival.
- Copy the table or save it as CSV.
Formula
S(t) = product over event times t(i) <= t of (1 - d(i) / n(i))
standard error = S(t) x sqrt(sum of d(i) / (n(i) x (n(i) - d(i))))
interval = S(t) +/- z x standard error, kept between 0 and 1
d(i) is the number of events at time t(i) and n(i) the number still being followed just before it. The standard error is Greenwood's formula. If everyone still at risk has the event at the same time, survival drops to 0 and the standard error is not defined.
Twenty-one items followed over time
The default data have 21 items, 9 with an event and 12 censored. At time 6 there are 21 at risk and 3 events, so survival is 1 - 3/21 = 0.8571 (standard error 0.0764, interval 0.707 to 1.000). At time 7 there are 17 at risk and 1 event, so survival falls to 0.8571 x 16/17 = 0.8067.
Later steps give 0.7529 at time 10, 0.6902 at 13, 0.6275 at 16, 0.5378 at 22 and 0.4482 at 23. The curve first reaches 0.5 or below at time 23, so the median survival time is 23 in whatever unit the times use.
What censored means
An item is censored when it stops being observed before the event happens, for example because the study ended or the item was lost to follow-up. Throwing those items away would bias the result, and counting them as events would too. The Kaplan-Meier method keeps them in the at-risk count up to their last time and then removes them.
The method assumes that censoring is not linked to the chance of the event. If items leave the study because they are about to have the event, the curve is too optimistic.
Using the table and the median
The curve is a step function, so between event times survival stays flat. The median survival time is the first time the curve reaches 0.5 or below. If the curve never gets that low, the page says "Not reached". The intervals are approximate and become wide when few items remain at risk. For a plain look at counts across values, see the Frequency Distribution Calculator; for a 2 by 2 comparison of event rates, the Odds Ratio and Relative Risk Calculator.
More statistics tools
For reliability, shape and probability questions, try the Coupon Collector Calculator, Markov Chain Calculator and Cronbach's Alpha Calculator.
Assumptions and limits
- Times are measured from the same starting point for every item, in one unit.
- Items are independent, and censoring is unrelated to the chance of the event.
- An event and a censoring at the same time are ordered so the censored item is still at risk when the event happens.
- This is a description of the sample you entered. It makes no clinical claim and is not medical advice.
Frequently asked questions
What unit are the times in?
Whatever you typed: days, months, hours or cycles. Use one unit for all lines. The median is reported in the same unit.
Why does survival not change at some times?
Those times have only censored items, so nothing happened that lowers survival. The at-risk count still drops, which makes later steps larger.
Why is the standard error blank at the end?
When the last item at risk has the event, survival becomes 0 and Greenwood's formula divides by zero, so no standard error exists there.
Can I compare two groups?
Not on this page. Run each group separately and compare the curves and medians; a formal comparison needs a test such as the log-rank test, which is not included.