Skip to content
Prev 12434 / 20628 Next

Multiple independent random effects

Michael Cone <coanil at ...> writes:
It's possible, but not easy.
  http://rpubs.com/bbolker/varfac shows how to set up 
formulae/model structures that allow for different RE variances,
or different residual variances, across different levels of a
fixed treatment factor.

  Basically, you have to set up an observation-level random
effect and dummy variables for each level of C other than
the first, then add

 (0+cLevel2|obs) + (0+cLevel3|obs) + (0+cLevel4|obs) ...

or equivalently you can use

 (0+dummy(C,"level2")|obs) + (0+dummy(C,"level3")|obs) + ...

  This is more elegantly doable with the flexLambda development
branch ...