Skip to content
Prev 12866 / 20628 Next

Modelling random effects for only part of the observations (in lme4)

Thierry ONKELINX wrote:
Great! Thanks. This works perfectly.

And I now understand what's going on in the formula too. The lme4 syntax is rather elegant. :)

The fixed effect estimates are near identical to estimates based on lm(y ~ arm), while the standard errors are different, which is exactly what would be expected. The reason they're not exactly identical is that one treatment group had only 2 subjects, so the design was not perfectly balanced. If I change it to a balanced design (equal number of subjects in each treatment group), the estimates are identical between lmer and lm (while of course the standard errors still differ).