The model object
must be fitted with restricted maximum
likelihood (i.e. with REML=TRUE
). If the object is fitted with
maximum likelihood (i.e. with REML=FALSE
) then the model is
refitted with REML=TRUE
before the p-values are calculated. Put
differently, the user needs not worry about this issue.
An F test is calculated according to the approach of Kenward and Roger
(1997). The function works for linear mixed models fitted with the
lmer
function of the lme4 package. Only models where the
covariance structure is a sum of known matrices can be compared.
The largeModel
may be a model fitted with lmer
either using
REML=TRUE
or REML=FALSE
. The smallModel
can be a model
fitted with lmer
. It must have the same covariance structure as
largeModel
. Furthermore, its linear space of expectation must be a
subspace of the space for largeModel
. The model smallModel
can also be a restriction matrix L
specifying the hypothesis \(L
\beta = L \beta_H\), where \(L\) is a \(k \times p\) matrix and
\(\beta\) is a \(p\) column vector the same length as
fixef(largeModel)
.
The \(\beta_H\) is a \(p\) column vector.
Notice: if you want to test a hypothesis \(L \beta = c\) with a \(k\)
vector \(c\), a suitable \(\beta_H\) is obtained via \(\beta_H=L c\)
where \(L_n\) is a g-inverse of \(L\).
Notice: It cannot be guaranteed that the results agree with other
implementations of the Kenward-Roger approach!