Skip to content
Prev 427 / 20628 Next

Nested Mixed Models in lme4

Dear Prof. Bates,
yes, thank you a lot! All your corrections are 
appropriate! inst should have been type and all 
variables should have been categorical. My mistake.
Also: as you correctly pointed out, the data are 
from a computer experiment and perfectly balanced, 
and by group factors I meant blocking factors.

Your very clear explanation solved my concerns 
about the nesting! Thanks!

I've also redone the comparison with SAS and now 
results correspond.
The reason was mainly that I needed a quite 
different formula:

lmer(err~initial*neighborhood + initial*k + 
initial*type + initial*size + initial*dens + 
neighborhood*k + neighborhood*type + 
neighborhood*size + neighborhood*dens + k*type + 
k*size + k*dens + type*size + type*dens + 
size*dens + initial*neighborhood*k + 
(1|inst),data=Case3)

True also that we were using lsmeans in SAS that 
you discourage.

To me it would remain only to understand how I 
could obtain the results in a cell means format 
like those in SAS. But this seems to be a problem 
also in lm and hence I must probably study better 
how things work to find the way. Trying something 
of the kind:

fmm1 <- 
lmer(err~-1+ordered(size)+dens+type+(k+initial+neighborhood)^3+(1|inst),data=Case3)

does not seem to help much.

I left all the analysis I did, code + results, 
(SAS and R) at:

http://www.imada.sdu.dk/~marco/Mixed/


Thank you a lot very much for the help!

Best regards,

Marco