How long does it take until an event? (Kaplan-Meier)
In brief
You want to know how long it takes until something happens - for example a study dropout or reaching a learning goal - and whether groups differ in this. Not everyone has experienced the event when observation ends: they are censored. Kaplan-Meier uses them too and shows as a step curve what proportion has not yet experienced the event at each time.
What the table looks like
One row per person. You need the column with the time (a number: semesters, days, weeks - up to the event or to the end of observation) and a column that says whether the event occurred (two values, such as 0 and 1). Optional: a column with the groups (2 to 8). Statable suggests which value is the event; you can switch it.
If the event column has only one value, the checklist says how Statable reads it. If everyone experienced the event (for example only 1), this is a valid case without censoring: Statable calculates the curve, median and interval as R survfit does. If everyone is censored (for example only 0), nothing occurred for anyone - the curve would stay at 100% and there is nothing to estimate.
Reading the result
- The curve starts at 1 and drops at every event. Vertical ticks are censored people. Below the chart is the number at risk; where it is small, the curve is uncertain.
- The median time is the point at which the curve falls to 50%. If it never falls below, “not reached” is shown; the proportions at fixed times help then.
- The log-rank test checks whether the curves of the groups are the same. It tells whether a difference is shown, not how large it is.
Requirements and limits
- Leaving the observation must be unrelated to the risk (non-informative censoring). Statable cannot check this.
- Rule of thumb: at least 10 events per group. With fewer, Statable shows a note.
- If the curves cross, the log-rank test easily misses a difference. Statable reports this.
- Everybody has the same starting point (for example start of studies). Several events per person or competing events are not possible here.
If several characteristics are to act on the time to the event at once (group, age, prior achievement), "More options" offers the Cox regression with hazard ratios. It calculates with R and is described in the article "Cox regression".
Log-rank: χ²(1) = 3.40, p = .065; Mdn (maintenance) = 31, 95% CI [18, -]; Mdn (no maintenance) = 23, 95% CI [8, -]; 23 people, 18 events; - = not reached
For specialists
Own code, checked against R (survival 3.8: survfit with conf.type = "log", summary with times, survdiff with rho = 0; data aml and lung). Product-limit estimator, Greenwood standard error, interval on the log scale (capped at 1). Median and limits as in print(survfit): the first time the curve lies below 50%; if it lies exactly at 50%, the midpoint to the next step. Log-rank after Mantel-Cox with the covariance from the hypergeometric distribution, df = groups − 1; pairwise one test each with df = 1, Holm. Weighted variants (Breslow, Tarone-Ware, Peto-Peto) and Cox regression are not offered by Statable.
Typical examples
- Time to dropping out of studies; those still studying are censored.
- Time to return to work after an illness.