There is an issue with implicit nesting in lmer. In your lme() model you nest block/irrigation/density/fertilizer. In lmer you need to do something like (I dind't include all of your variables, but I think the makes the point)
lmer(yield~irrigation*density*fertilizer+(1|fertilizer:density)+(1|density), data)
Which notes that fertilizer is nested in density.
Try this and then compare the results.
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Ronaldo Reis-Jr.
Sent: Tuesday, October 25, 2005 12:21 PM
To: R-Help
Subject: Re: [R] lme and lmer syntax
Em Seg 24 Out 2005 18:08, Doran, Harold escreveu:
Ronaldo
See the article on lmer pasted below for syntax. It is the only
current source documenting the code. In lmer(), the nesting structure
for the ranmdom effects is handled in a slightly different way. If
your observations are nested as you note, then you can use
lmer(y~x1 + x2 +(1|x1) + (1|x2), data)
@Article{Rnews:Bates:2005,
author = {Douglas Bates},
title = {Fitting Linear Mixed Models in {R}},
journal = {R News},
year = 2005,
volume = 5,
number = 1,
pages = {27--30},
month = {May},
url = {http://CRAN.R-project.org/doc/Rnews/},
}
Hi,
I try this with a splitsplitplot example.
I make the correct model with aov, lme do compare with lmer.
But I cant make a correct model in lmer. Look that the aov and lme results are similars, but very different from lmer. In aov and lme is used the correct DF for each variable, in lmer it use a same DF for all? Denom=54.
What is my mistake?
Thanks
Ronaldo
----- Begin of example ------
summary(splitplot)
yield block irrigation density fertilizer
Min. : 60.00 A:18 control :36 high :24 N :24
1st Qu.: 86.00 B:18 irrigated:36 low :24 NP:24
Median : 95.00 C:18 medium:24 P :24
Mean : 99.72 D:18
3rd Qu.:114.00
Max. :136.00