surv_split | R Documentation |
This is similar to survSplit
but allow the starting
time and ending time to be equal (e.g., immediate death, automatic default in
loan) and automatically include min and max of duration in the cut intervals
surv_split(
x,
duration,
event,
cuts,
time_varying = NULL,
label_episode = FALSE
)
x |
data frame |
duration |
exposure time |
event |
binary 0 and 1 coded |
time_varying |
not in use |
label_episode |
set to TRUE to have the episode labeled with actual cut intervals, otherwise episodes are integers |
cut |
the cut points on duration forming intervals [min_duration, first_value], (first_value, second_value], ..., (last_value, max_duration] |
The tested speed is 1.37 times to that of survSplit.
x <- data.frame(time = c(5, 10), event = c(1, 0))
surv_split(x, "time", "event", c(2,4,6))
surv_split(x, "time", "event", c(2,4,6), label_episode = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.