survsplit: Split a Survival Data Set at Specified Times

survsplitR 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 start doesn't already exist, this is the time that the original records start. May be a vector or single value.

episode

character string with name of new episode variable (optional).

interval

this argument is used by max.lik function

Value

New, longer, data frame.

See Also

survSplit.


relsurv documentation built on Dec. 28, 2022, 2:25 a.m.

Related to survsplit in relsurv...