mkReTrms {reformulas} | R Documentation |
Create list of structures needed for models with random effects
Description
From the result of findbars
applied to a model formula and
and the evaluation frame, create the model matrix, etc. associated with
random-effects terms. See the description of the returned value for a
detailed list.
Usage
mkReTrms(
bars,
fr,
drop.unused.levels = TRUE,
reorder.terms = TRUE,
reorder.vars = FALSE,
calc.lambdat = TRUE
)
Arguments
bars |
a list of parsed random-effects terms |
fr |
a model frame in which to evaluate these terms |
drop.unused.levels |
(logical) drop unused factor levels? |
reorder.terms |
arrange random effects terms in decreasing order of number of groups (factor levels)? |
reorder.vars |
arrange columns of individual random effects terms in alphabetical order? |
calc.lambdat |
(logical) compute |
Value
a list with components
Zt |
transpose of the sparse model matrix for the random effects |
Ztlist |
list of components of the transpose of the random-effects model matrix, separated by random-effects term |
Lambdat |
transpose of the sparse relative covariance factor |
Lind |
an integer vector of indices determining the mapping of the
elements of the |
theta |
initial values of the covariance parameters |
lower |
lower bounds on the covariance parameters |
flist |
list of grouping factors used in the random-effects terms |
cnms |
a list of column names of the random effects according to the grouping factors |
Gp |
a vector indexing the association of
elements of the conditional mode vector
with random-effect terms; if |
nl |
names of the terms (in the same order as |
References
Bates D, Mächler M, Bolker B, Walker S (2015). “Fitting Linear Mixed-Effects Models Using lme4.” Journal of Statistical Software, 67(1), 1–48. doi:10.18637/jss.v067.i01.)
See Also
Other utilities:
expandDoubleVerts()
,
nobars()
,
subbars()