make_X: Construct full data set with time-dependent covariate (TDC)

Description Usage Arguments

Description

Construct full data set with time-dependent covariate (TDC)

Usage

1
2
3
4
5
make_X(n = 500L, m = 30, te = -29:30, h0 = -2, f0 = function(t) {    
  0 * t }, fz = function(t, te, z) {     (-(te - min(te))/10 + 0.005 * (te -
  min(te))^2) * z }, fwindow = function(t, te) {     (te <= t) & (te >= t -
  30) }, rng_z = function(te) {     arima.sim(n = length(te), list(ar = c(0.8,
  -0.6))) })

Arguments

n

Number of subjects to simulate.

m

the number of follow up intervals (t_end = 1:m)

te

the vector of timepoints at which the TDC was observed

h0

A constant component of the baseline hazard.

f0

A function of time t, representing the smooth part of the baseline hazard.

fz

A function of time t, exposure time te and the TDC z, representing the partial effect of z at te on the hazard at t.

fwindow

A function of time t and exposure time te defining the "window of effectiveness" during which exposures affect the hazard at time t. Should return TRUE/FALSE.

rng_z

RNG for TDC $z(t_e)$, a function of te. Must return a vector of same length as te.


adibender/pamm documentation built on May 14, 2019, 5:22 p.m.