add_tdc {pammtools}R Documentation

Add time-dependent covariate to a data set

Description

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.

Usage

add_tdc(data, tz, rng_fun, ...)

Arguments

data

A data set with variables specified in formula.

tz

A numeric vector of exposure times (relative to the beginning of the follow-up time t)

rng_fun

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.


[Package pammtools version 0.5.93 Index]