tvcov {event} | R Documentation |
tvcov(y, x, tx)
y |
Vector of times. |
x |
Vector covariate. |
tx |
Vector of times at which x changes. |
tvcov
creates a vector of length sum(y)
of time-varying
covariates for use with ehr
. It may also be used to create
weight vectors.
J.K. Lindsey
bp
, ehr
,
ident
, pp
,
tccov
, tpast
,
ttime
.
y <- c(5,3,2,4) x <- c(1,2,2,1,2,2,1) tx <- c(2,3,1,2,2,2,2) zcov <- tvcov(y, x, tx) zcov