survsplit {relsurv} | R Documentation |
Split a Survival Data Set at Specified Times
Description
Given a survival data set and a set of specified cut times, the function splits
each record into multiple records at each cut time. The new data
set is be in counting process
format, with a start time, stop
time, and event status for each record. More general than survSplit
as it also works with the data already in the counting process
format.
Usage
survsplit(data, cut, end, event, start, id = NULL, zero = 0,
episode = NULL,interval=NULL)
Arguments
data |
data frame. |
cut |
vector of timepoints to cut at. |
end |
character string with name of event time variable. |
event |
character string with name of censoring indicator. |
start |
character string with name of start variable (will be created if it does not exist). |
id |
character string with name of new id variable to create (optional). |
zero |
If |
episode |
character string with name of new episode variable (optional). |
interval |
this argument is used by |
Value
New, longer, data frame.