So far, two specials are implemented. concurrent is used when the goal is to estimate a concurrent effect of the TDC. cumulative is used when the goal is to estimate a cumulative effect of the TDC. These should usually not be called directly but rather as part of the formula argument to as_ped. See the vignette on data transformation for details.

cumulative(..., tz_var, ll_fun = function(t, tz) t >= tz, suffix = NULL)

concurrent(..., tz_var, lag = 0, suffix = NULL)

has_special(formula, special = "cumulative")

Arguments

...

For concurrent variables that will be transformed to covariate matrices. The number of columns of each covariate depends on tz. Usually, elements that will be specified here are time (which should be the name of the time-variable used on the LHS of the formula argument to as_ped), tz which is the variable containing information on the times at which the TDC was observed (can be wrapped in latency) and the TDCs that share the same tz and Lag-lead window (ll_fun).

tz_var

The name of the variable that stores information on the times at which the TDCs specified in this term where observed.

ll_fun

Function that specifies how the lag-lead matrix should be constructed. First argument is the follow up time second argument is the time of exposure.

lag

a single positive number giving the time lag between for a concurrent effect to occur (i.e., the TDC at time of exposure t-lag affects the hazard in the interval containing follow-up time t). Defaults to 0.

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. 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.

special

The name of the special whose existence in the formula should be checked