survsplit function

Split a survival data set at specified cut points

Split a survival data set at specified cut points

For a given survival dataset and specified cut times, each record is split into multiple subrecords at each cut time. The resulting dataset is in counting process format, with each subrecord containing a start time, stop time, and event status. This is adapted from the survsplit.c function from the survival package.

survsplit(tstart, tstop, cut)

Arguments

  • tstart: The starting time of the time interval for counting-process data.
  • tstop: The stopping time of the time interval for counting-process data.
  • cut: The vector of cut points.

Returns

A data frame with the following variables:

  • row: The row number of the observation in the input data (starting from 0).
  • start: The starting time of the resulting subrecord.
  • stop: The stopping time of the resulting subrecord.
  • censor: Whether the subrecord lies strictly within a record in the input data.
  • interval: The interval number.

Examples

survsplit(15, 60, c(10, 30, 40))

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

  • Maintainer: Kaifeng Lu
  • License: GPL (>= 2)
  • Last published: 2025-03-20

Useful links