The Kaplan-Meier (product-limit) estimate of the survival function from times with event/censoring indicators, evaluated at time t, and the whole step curve.
\hat{S}(t) = \prod_{t_i \le t}\left(1 - \frac{d_i}{n_i}\right)
Inputs
times follow-up times vectorevents 1 = event observed, 0 = censored vectort time at which to report S(t)
Returns
survival S(t)event_times distinct event timessurvival_curve S just after each event time
Applies when
- non-informative censoring
- a censoring at an event time counts as still at risk
Example
m.ask("Kaplan-Meier: times [6, 6, 6, 7, 10, 13, 16, 22, 23] with events [1, 1, 1, 0, 1, 1, 1, 1, 1]; find the survival at t = 12.")
→ survival = 0.533333, event_times = [6.0, 10.0, 13.0, 16.0, 22.0, 23.0], survival_curve = [0.6666666666666667, 0.5333333333333334, 0.4000000000000001, 0.2666666666666668, 0.1333333333333334, 0.0]