2

Take this mixed effects model in R:

$y_i = \beta_0 + \beta_1X_{ij} + u_{j} + e_{ij}$

where $u$ is a random effect (level 2 residual) with groups $j$. It is possible to allow the variance of $e_{ij}$ (level 1 residuals) to be a function of $X$. This could potentially result in a 'fanning out' or 'fanning in' of level 1 residuals within each group $j$.

Is it possible to implement this 'complex level 1 variance' mixed effects model in R? Does lme4 allow it?

(Stack Overflow doesnt appear to allow LaTeX formatting of mode formula so I've asked this question here)

luciano
  • 12,197
  • 30
  • 87
  • 119

1 Answers1

2

lme4 does not offer possibility to model variance components, however it is possible with nlme package, where you can define different variance functions. Check also this answer and the references: Modeling error structure in lmer in R?

Tim
  • 108,699
  • 20
  • 212
  • 390
  • Why is this feature implemented in an older version of lme but not a newer version? – luciano Dec 26 '14 at 15:54
  • `nlme` is not older version of `lme4`, I don't know why it was not implemented in `lme4` - you could ask the authors. – Tim Dec 26 '14 at 16:22