[R] lme and lmer syntax

John Wilkinson (pipex) wilks at dial.pipex.com
Wed Oct 26 15:05:57 CEST 2005


Ronaldo,

According to Douglas Bates's paper in 'R' News, It would seem that the
correct model for nested split plot random effects with lmer , in your
example ,with x2 nested within x1, would be --

lmer(y~x1 + x2 +(1|x1)+(1|x1:x2))

Try it with your model any see how it compares with your aov and lme models,

John


m 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




More information about the R-help mailing list