Re: [R] Use predict() after lmer() (library lme4)

2016-02-03 Thread Thierry Onkelinx
Dear Marc, This question is more suited for R-Sig-mixed models to which I'm forwarding it. Your manual predictions for out3 are wrong. Here are the correct manual predictions. fixed <- model.matrix(~effect, data = dataF) %*% fixef(out3) random <- rowSums(model.matrix(~Sector, data = dataF) *

[R] Use predict() after lmer() (library lme4)

2016-02-02 Thread Marc Girondot
Bonjour, (don't worry, after I will write in English [at least I will try ;) ]) I try to understand better mixed models and then I have generated data and I try to understand how the fixed and the random effects are used in predict(). I understand when the random effect is of the form (1 |