Learn R Programming

SteppedPower (version 0.1.0)

construct_CovBlk: Construct a Block of the Covariance Matrix

Description

Constructs the covariance matrix for multiple measurements of the same cluster. This function is not designed to be used directly.

Usage

construct_CovBlk(
  sigma,
  tau,
  eta = NULL,
  tauAR = NULL,
  etaAR = NULL,
  rho = NULL
)

Arguments

sigma

numeric (vector of length `timepoints`), residual error

tau

numeric (vector of length `timepoints`), standard deviation of random intercepts

eta

numeric (vector of length `timepoints`), standard deviation of random slope

tauAR

numeric (scalar), value between 0 and 1. Defaults to NULL. If `tauAR` is not NULL, the random intercept `tau` is AR1-correlated. *Currently not compatible with `rho`!=0 !*

etaAR

numeric (scalar), value between 0 and 1. Defaults to NULL. If `etaAR` is not NULL, the random slope `eta` is AR1-correlated. *Currently not compatible with `rho`!=0 !*

rho

numeric (scalar), correlation of `tau` and `eta`

Value

a block of a covariance matrix, corresponding to intra-cluster covariance over time for one cluster

Examples

Run this code
# NOT RUN {
construct_CovBlk(sigma=rep(2,5), tau=rep(1,5))
# }

Run the code above in your browser using DataLab