Create or add to a time-varying covariate (tvcov) object

Usage

tvctomat(tvcov, names=NULL, index=NULL, tccov=NULL, oldtvcov=NULL)

Arguments

tvcov A list of matrices with time-varying covariate values for each individual (one column per variable), one matrix or dataframe of such covariate values (when there is only one such covariate), or an object of class, tvcov.
names The names of the time-varying covariates in tvcov (if the matrices do not have column names) or the name of the time-constant covariate.
index The index numbers or names of variables in tvcov, with that class, for which an interaction is to be added or one such number or name for an interaction with a time-constant covariate.
oldtvcov An object of class, tvcov, to which tvcov is to be added.

Description

tvctovmat transforms a list of matrices with time-varying covariates for each individual or one matrix or dataframe of such covariate values into an object of class, tvcov, or combines two such objects. It can also add interactions among covariates.

Such objects can be printed. Methods are available for extracting the covariates and their names.

Value

Returns an object of class, tvcov, containing a matrix for the covariates (z$tvcov) with one row per response per individual and a vector giving the number of observations per individual (z$nobs).

Author(s)

J.K. Lindsey

See Also

gettvc, read.list, restovec, rmna, tcctomat.

Examples

z <- matrix(rpois(20,5),ncol=5)
tvctomat(z)


[Package Contents]