[R] difference between lme and lmer in df calculation

From: Jarrett Byrnes <jebyrnes_at_ucdavis.edu>
Date: Sun, 17 Feb 2008 14:38:28 -0800

Hello all. I'm currently working with mixed models, and have noticed a curious difference between the nlme and lmer packages. While I realize that model selection with mixed models is a tricky issue, the two packages currently produce different AIC scores for the same model, but they systematically differ by 2. In looking at the logLik values for each method, I find that they indeed differ by 1. So, the following code:

utils::data(npk, package="MASS")

a<-lmer(yield ~ 1+(1|block), data=npk)

b<-lme(yield ~ 1, random=~1|block, data=npk) logLik(b)

produces a df of 2 for a, and a df of 3 for b. I'm guessing that lmer is not accounting for the level-1 variance. Is this the case, and, if so, will this be fixed?

I see that this issue was brought up sometime back. Is there a reason it has not been addressed?

Incidentally, I'm also curious what folk think about the approach to using the conditional AIC value as posted here https://stat.ethz.ch/pipermail/r-help/2008-February/154389.html



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 17 Feb 2008 - 23:14:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 18 Feb 2008 - 00:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive