Learn R Programming

event (version 1.1.2)

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)

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.

Arguments

y

Vector of times.

x

Vector covariate.

tx

Vector of times at which x changes.

Author

J.K. Lindsey

See Also

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

Examples

Run this code
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