Given a data set in standard format (with one row per subject/observation),
this function adds a column with the specified exposure time points
and a column with respective exposures, created from rng_fun
.
This function should usually only be used to create data sets passed
to sim_pexp
.
add_tdc(data, tz, rng_fun, ...)
A data set with variables specified in formula
.
A numeric vector of exposure times (relative to the
beginning of the follow-up time t
)
A random number generating function that creates
the time-dependent covariates at time points tz
.
First argument of the function should be n
, the number of
random numbers to generate. Within add_tdc
, n
will be set
to length(tz)
.
Currently not used.