Learn R Programming

event (version 1.1.1)

tvcov: Create a Vector of Time-varying Covariates for a Point Process

Description

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.

Usage

tvcov(y, x, tx)

Arguments

y

Vector of times.

x

Vector covariate.

tx

Vector of times at which x changes.

Value

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.

See Also

bp, ehr, ident, pp, tccov, tpast, ttime.

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab