[R-sig-ME] Different variance estimates from lmer and lmer2

Jonathan Bartlett Jonathan.Bartlett at lshtm.ac.uk
Tue May 22 19:13:44 CEST 2007


Dear all

For some mixed models, I get different variance estimates if I use lmer
compared to using lmer2. Is there a reason why the two commands are
giving quite different estimates?

The analysis below is from page 168 of "Extending the linear model with
R" by Faraway, using the dataframe irrigation from the faraway package.
Strangely, the results using lmer2 agree with the book, whereas lmer
gives slightly different estimates.

I have am running R 2.5.0 with lme4 version 0.99875-0 on WinXP.

lmod <- lmer(yield ~ irrigation * variety + (1|field),data=irrigation)
> summary(lmod)
Linear mixed-effects model fit by REML 
Formula: yield ~ irrigation * variety + (1 | field) 
   Data: irrigation 
  AIC   BIC logLik MLdeviance REMLdeviance
 63.4 70.35  -22.7      68.62         45.4
Random effects:
 Groups   Name        Variance Std.Dev.
 field    (Intercept) 15.5182  3.9393  
 Residual              2.1919  1.4805  
number of obs: 16, groups: field, 8

....

> lmod <- lmer2(yield ~ irrigation * variety +
(1|field),data=irrigation)
> summary(lmod)
Linear mixed-effects model fit by REML 
Formula: yield ~ irrigation * variety + (1 | field) 
   Data: irrigation 
  AIC   BIC logLik MLdeviance REMLdeviance
 63.4 70.35 -22.70      68.61        45.39
Random effects:
 Groups   Name        Variance Std.Dev.
 field    (Intercept) 16.1991  4.0248  
 Residual              2.1076  1.4518  
Number of obs: 16, groups: field, 8

lmer2, the book and Stata's xtmixed give the estimate of the random
intercept SD as 4.02, whereas lmer gives it as 3.94.

My apologies if the reason for such differences is down to a mistake on
my part - I was unable to find any postings on the list regarding this
issue.

Many thanks
Jonathan
London School of Hygiene and Tropical Medicine
www.lshtm.ac.uk




More information about the R-sig-mixed-models mailing list