The function fits a mixed linear model using ordinary least squares (OLS) or
generalized least squares (GLS) estimation of coefficients for fixed effects, and
maximum likelihood (ML) or restricted ML (REML) for random effects, over any
number of random permutations of the data, but the permutations are mostly
restricted to occur with subject blocks for any model terms other than subjects.
Most functionality should resemble that of lm.rrpp and lm.rrpp.ws,
with some caveats. First, estimation of random effects uses the methodology of the
lmer function (Bates et al., 2015),
for only one random term based on a subjects designation.
Second, this means that a "random slopes" model involves an interaction between subjects and a numeric
variable (not a categorical variable). Third, although any number of fixed effects can be used,
only one fixed effect can interaction with subjects. Finally, the function is intended to allow
analysis of variance (ANOVA), like with lm.rrpp.ws, but not treated random
effects as fixed.
There is not a coefficients test associated with this function, as with other lm.rrpp
that include only fixed effects.
Although this function allows covariance matrices to be used for generalized least squares (GLS)
estimation of fixed effects, it does not currently
expand the covariance mnatrix based only on subjects, as does
lm.rrpp.ws. However, that function can be used to obtain a covariance matrix for this
function. The covariance structure (Lambda matrix) among subjects is estimated via ML or REML (Bates et al., 2015) and
is not impacted by the expected covariances among fixed effects, however, the expected covariances
will influence interactions between fixed and random effects. The Lambda matrix is estimated as a single matrix,
even for multivariate data. This matrix is obtained by projecting data onto the first component of
a singular value decomposition of the product between the data and a hat matrix of the the fixed effects
(basically projection following a principal component analysis of model fitted values). This is a computationally
proficient step that is similar to averaging covariance parameters (theta) over all variables.
If independent Lambda matrices are desired, then this function can be used on, e.g., each principal
component of data, followed by combining the coefficients. For ANOVA, the precise estimation of Lambda
is not as important for tests of fixed effects, as it means a linear transformation of coefficients
that would be consistent across random permutations of RRPP. It might be more important for model
comparison and selection, in which case whether to use LS, ML, REML, and whether to use separate Lambda matrices
is a much deeper consideration.
A data frame (preferably an rrpp.data.frame object) must be
used for this function. Not all "downstream" functions (e.g., logLik, predict) are guaranteed
to work as expected, as this function is still very much under development.
The lm.rrpp arguments not available for this function include:
full.resid, block, and SS.type. These arguments are fixed because of
the within-subject blocking for tests, plus the requirement for type II SS
for within-subject effects.