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

Description Usage Arguments Examples

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

1
2
split_tdc(formula, event_df, tdc_df, id_var, time_var, status_var,
  cens_value = 0)

Arguments

formula

a model formula

event_df

A data frame (potentially) containing time-dependent covariates.

tdc_df

A data frame containing information on time-dependent variables in long format. Needs to contain a "time" variable indicating when the TDCs change their value. Must have same name as variable indicating event times in event_df.

id_var

The ID variable name, identifying subjects. Needs to be the same name in both data sets.

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.

Examples

1
2
3
4
5
data("pbc", package="survival")# loads both, pbc and pbcseq
pbc$status = 1*(pbc$status == 2)
pbcseq$time <- pbcseq$day # time of event/measurement must be equal in both data 
pbcseq$day  <- NULL
pbc_ped     <- split_tdc(Surv(time, status)~., pbc, pbcseq, "id", "time", "status")

adibender/pam documentation built on May 10, 2019, 5:54 a.m.