km | R Documentation |
This function exclusively returns the Kaplan-Meier survival estimate and the corresponding time points.
It does not provide standard errors or any additional outputs
that are typically included with the survfit()
function.
km(time, status)
time |
A numeric vector for the observed survival times. |
status |
A numeric vector for the event indicator; 0 indicates right-censoring and 1 indicates events. |
A data frame with the Kaplan-Meier survival estimates, containing:
time |
Time points at which the survival probability is estimated. |
surv |
Estimated survival probability at each time point. |
data(Teeth500)
km(Teeth500$time, Teeth500$event)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.