Adapted from lme4, this function constructs the design matrix (Z), variance-covariance matrix (G), etc.
mkReTrms(
bars,
fr,
drop.unused.levels = TRUE,
reorder.terms = FALSE,
reorder.vars = FALSE
)A list with the following components:
Zt: Transposed random-effects design matrix.
G: Variance-covariance matrix for random effects.
Gind: Index mapping variance-covariance parameters to their positions in G.
G_temp: List of individual variance component matrices for each random effect.
flist: List of grouping factors used in random effects.
cnms: Column names of the random-effects design matrix.
Ztlist: List of per-term transposed design matrices for random effects.
nl: Number of levels for each grouping factor.
a list of parsed random-effects terms
a model frame in which to evaluate these terms
(logical) drop unused factor levels?
arrange random effects terms in decreasing order of number of groups (factor levels)?
arrange columns of individual random effects terms in alphabetical order?