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.
survsplit(
data,
cut,
end,
event,
start,
id = NULL,
zero = 0,
episode = NULL,
interval = NULL
)
New, longer, data frame.
data frame.
vector of timepoints to cut at.
character string with name of event time variable.
character string with name of censoring indicator.
character string with name of start variable (will be created if it does not exist).
character string with name of new id variable to create (optional).
If start
doesn't already exist, this is the time that the
original records start. May be a vector or single value.
character string with name of new episode variable (optional).
this argument is used by max.lik
function