[R-sig-ME] Random-effects variance-covariance matrix in lmer?
Phillip Alday
ph||||p@@|d@y @end|ng |rom mp|@n|
Wed Oct 2 16:29:41 CEST 2019
This is a frequent question for lme4 and MixedModels.jl and the answer
is....
it's not going to be supported in any mainstream release of either
package in the foreseeable future.
You can however still get some of these structures by clever
specification of the random effects.
For example:
data(Machines,package="nlme")
library("lme4")
m <- lmer(score ~ 1 + Machine + (0+Machine|Worker), Machines)
# with compound symmetry
m_cs <- lmer(score ~ 1 + Machine + (1|Worker) + (1|Worker:Machine),
Machines)
# pdDiag -- for continuous variables, you could just use the || syntax
m_diag <- lmer(score ~ 1 + Machine + (0+dummy(Machine,"A")|Worker) +
(0+dummy(Machine,"B")|Worker) + (0+dummy(Machine,"C")|Worker), Machines)
I'll leave pdIdent as an exercise for the OP. ;)
Best,
Phillip
On 02/10/2019 15:50, matthias.suter using agroscope.admin.ch wrote:
> Hi all
>
> I'm looking for a way to specify a more complex variance-covariance matrix for the random effects in lmer(). For example, in lme() (nlme package), there are the pdMat classes to specify e.g. a compound symmetry (pdCompSym) or a multiple of an identity (pdIdent) structure for the variance-covariance matrix of random effects. Is there a possibility to code an equivalent for lmer()? I'm specifically interested in "compound symmetry" and "multiple of an identity".
>
> I assume that Douglas Bates or Ben Bolker have a distinct answer on that.
>
> Thanks in advance,
> Matthias
>
>
> ---------------------------------------------------------
> Matthias Suter, Dr.sc.nat.
> Forage Production and Grassland Systems
>
> Agroscope
> Reckenholzstrasse 191, CH-8046 Z�rich
>
> Phone +41 58 468 75 90
> Fax +41 58 468 72 01
> matthias.suter using agroscope.admin.ch
> www.agroscope.ch
> ---------------------------------------------------------
>
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list