Constructs the covariance matrix for multiple measurements of the same cluster if the same individuals are observed at all time periods. This function is not designed to be used directly.
construct_CovSubMat(
N,
timepoints,
sigma,
tau,
eta = NULL,
AR = NULL,
rho = NULL,
gamma = NULL,
psi = NULL,
INDIV_LVL = FALSE
)
a block of a covariance matrix with two levels of clustering, corresponding to intra-cluster covariance over time for one cluster
Number of individuals per cluster
numeric (scalar or vector), number of timepoints (periods). If design is swd, timepoints defaults to length(Cl)+1. Defaults to 1 for parallel designs.
numeric (vector of length `timepoints`), residual error
numeric (vector of length `timepoints`), standard deviation of random intercepts
numeric (vector of length `timepoints`), standard deviation of random slope
numeric, vector containing up to three values, each between 0 and 1. Defaults to NULL. It defines the AR(1)-correlation of random effects. The first element corresponds to the cluster intercept, the second to the treatment effect and the third to subject specific intercept. If only one element is provided, autocorrelation of all random effects is assumed to be the same. *Currently not compatible with `rho`!=0 !*
numeric (scalar), correlation of `tau` and `eta`. The default is no correlation.
numeric (vector of length `timepoints`), standard deviation of a random time effect.
numeric (scalar), random subject specific intercept. Leads to a closed cohort setting
logical, should the computation be conducted on an individual level? This leads to longer run time and is mainly for diagnostic purposes.