[R] difference between lme and lmer in df calculation
Jarrett Byrnes
jebyrnes at ucdavis.edu
Sun Feb 17 23:38:28 CET 2008
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")
library(lme4)
a<-lmer(yield ~ 1+(1|block), data=npk)
logLik(a)
library(nlme)
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?
https://stat.ethz.ch/pipermail/r-help/2006-March/102520.html
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
Thanks!
-Jarrett
More information about the R-help
mailing list