R/split-data.R
split_data.RdFunction to transform data without time-dependent covariates into piece-wise exponential data format
split_data(
formula,
data,
cut = NULL,
max_time = NULL,
multiple_id = FALSE,
...
)A two sided formula with a Surv object
on the left-hand-side and covariate specification on the right-hand-side (RHS).
The RHS can be an extended formula, which specifies how TDCs should be
transformed using specials concurrent and cumulative. The
left-hand-side can be in start-stop notation. This, however, is only used
to create left-truncated data and does not support the full functionality.
Either an object inheriting from data frame or in case of time-dependent covariates a list of data frames (of length 2), where the first data frame contains the time-to-event information and static covariates while the second (and potentially further data frames) contain information on time-dependent covariates and the times at which they have been observed.
Split points, used to partition the follow-up into intervals.
If unspecified, all unique event times will be used. For competing risks,
when combine = TRUE split points are derived from all event types
combined.
If cut is unspecified, this will be the last
possible event time. All event times after max_time will be
administratively censored at max_time.
Are occurences of same id allowed (per transition).
Defaults to FALSE, but is sometimes set to TRUE, e.g., in case of
multi-state models with back transitions.
Further arguments passed to the data.frame method and
eventually to survSplit. Notably, id
(character string) sets the name of the subject identifier variable in
data, and, for competing risks data, combine (logical, default
TRUE) controls whether cause-specific data sets are stacked into a
single data frame with an additional cause column (TRUE) or
returned as a list of cause-specific data sets (FALSE); see the
competing-risks
vignette for details.