split_info: Transform standard time-to-event data to interval data...

Description Usage Arguments Examples

View source: R/split-survival-data.R

Description

Given a data set in standard format with one row per observation unit, transform the data set into interval data, where intervals are specified via breaks. Each observation unit will have as many rows as interval start points that it survived.

Usage

1
2
3
4
5
6
7
8
9
split_info(
  data,
  time_var = "time",
  status_var = "status",
  id_var = "id",
  breaks = NULL,
  right_closed = TRUE,
  max_end = FALSE
)

Arguments

data

Data set from which time and status variables will be extracted.

time_var

The variable storing event times.

status_var

The variable storing the event indicator.

id_var

The variable storing ID variable. Will be created if not in data set.

breaks

The time points of the interval borders.

right_closed

Logical. If TRUE (default), intervals are assumed right_closed closed and left open. If FALSE left closed and right_closed open.

max_end

logical. Should the last interval span until the last observed censoring or event time (if larger than the largest specified cut point).

Examples

1
2
data(ovarian, package="survival")
split_info(ovarian, futime, fustat, breaks = c(0, 59, 500, 1500))

adibender/ldatools documentation built on March 7, 2020, 5:30 a.m.