Skip to content
Prev 17961 / 20628 Next

Random-effects variance-covariance matrix in lmer?

Thanks, Philipp.

I was a aware of the pdDiag and the pdCorSym solution, and so I specifically asked for pdCompSym and pdIdent ...

As for your compound symmetry suggestion, it is not quite clear to me. Up to now, I would have named "(1|Worker:Machine)" a random interaction term, specifying a distinct level for each worker*machine combination (and that's what is given by ranef(m_cs). How does this relate to the covariance in the compound symmetry, where also a multiple of identity is fit to diagonal?

I have also tried to sort out the pdIdent equivalent, using similar coding as you suggest below, but was not successful so far. Do you know a similar solution?

Thanks again,
Matthias 




-----Urspr?ngliche Nachricht-----
Von: Phillip Alday <phillip.alday at mpi.nl> 
Gesendet: Mittwoch, 2. Oktober 2019 16:30
An: Suter Matthias Agroscope <matthias.suter at agroscope.admin.ch>; r-sig-mixed-models at r-project.org
Betreff: Re: [R-sig-ME] Random-effects variance-covariance matrix in lmer?

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 at agroscope.admin.ch wrote: