Learn R Programming

pammtools (version 0.1.9)

split_tdc: Create piece-wise exponential data in case of time-dependent covariates

Description

Given to data frames, one containing event time information (one row per subject) and one containing information on time-dependent covariates, creates piece-wise exponential data (with one split per event time and time at which a TDC changes its value).

Usage

split_tdc(formula, event_df, tdc_df, tz_var, id_var = "id",
  time_var = "time", status_var = "status", cens_value = 0,
  entry_time = 0, ...)

Arguments

formula

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.

event_df

Data frame (or similar) containing survival information.

tdc_df

Data frame (or similar) containing information on time-dependent covariates

tz_var

The time variable in tdc_df indicating time points at which time-dependent covariate (tdc) was observed. Needs to be the same name in both data sets.

id_var

The ID variable name, identifying subjects.

time_var

A character, specifies the column of the event or censoring time in event_df and the time of measurement for the time-dependent covariates in tdc_df.

status_var

As time_var, but specifies column containing the event indicator. Can be missing in the tdc_df.

cens_value

The value that indicates censoring in the status_var column.

entry_time

If scalar, the time-point at which the follow up for each observation unit begins. (Eventually, support for subject specific entry time could be supported through this argument).

...

Further arguments passed to the data.frame method and eventually to survSplit