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.
mkReTrms(
bars,
fr,
drop.unused.levels = TRUE,
reorder.terms = TRUE,
reorder.vars = FALSE,
calc.lambdat = TRUE
)
a list with components
transpose of the sparse model matrix for the random effects
list of components of the transpose of the random-effects model matrix, separated by random-effects term
transpose of the sparse relative covariance factor
an integer vector of indices determining the mapping of the
elements of the theta
to the "x"
slot of Lambdat
initial values of the covariance parameters
lower bounds on the covariance parameters
list of grouping factors used in the random-effects terms
a list of column names of the random effects according to the grouping factors
a vector indexing the association of
elements of the conditional mode vector
with random-effect terms; if nb
is the vector of numbers
of conditional modes per term (i.e. number of groups times number
of effects per group), Gp
is c(0,cumsum(nb))
(and conversely nb
is diff(Gp)
)
names of the terms (in the same order as Zt
,
i.e. reflecting the reorder.terms
argument)
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?
(logical) compute Lambdat
and Lind
components? (At present these components
are needed for lme4
machinery but not for glmmTMB
, and may be large in some cases; see Bates et al. 2015
lme4reformulas)
Other utilities:
nobars()
,
subbars()