survsplit function

Split a Survival Data Set at Specified Times

Split a Survival Data Set at Specified Times

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 )

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

Returns

New, longer, data frame.

See Also

survival::survSplit.

  • Maintainer: Damjan Manevski
  • License: GPL (>= 2)
  • Last published: 2025-01-28

Useful links