powered by
Simple, fast function to generate basic lifetables. No error checking is performed.
survfit_fast(time, events)
Returns a list format lifetable with the following entries:
"n"Number of patients
"time"Vector of times
"n.risk"Vector of numbers of patients at risk at each time
"n.event"Vector of numbers of patients with an event at each time
"n.censor"Vector of numbers of patients censored at each time
"surv"Vector of estimates of Survival function at each time
"se"Vector of standard errors of estimates of Survival function at each time
Vector of event/censoring times
Vector of indicators for whether each time is an event (1) or a censoring (0). Must be same length vector as time argument.
James Bell
survfit_fast(c(1,2,3,3,4,5),c(1,0,1,1,0,1))
Run the code above in your browser using DataLab