[R] lmer- why do AIC, BIC, loglik change?

From: Darren M. Ward <Darren.M.Ward_at_Dartmouth.EDU>
Date: Wed 18 Oct 2006 - 20:21:11 GMT


Hi all,

I am having issues comparing models with lmer. As an example, when  I run the code below the model summaries (AIC, BIC, loglik) differ between the summary() and anova() commands. Can anyone clear up what's wrong?

Thank you!

Darren Ward

library(lme4)
data(sleepstudy)
fm1<-lmer(Reaction ~ Days + (1|Subject), sleepstudy) summary(fm1)
fm2<-lmer(Reaction ~ Days + (Days|Subject), sleepstudy) summary(fm2)
anova(fm1, fm2)

Sample output:

> summary(fm1)

Linear mixed-effects model fit by REML
Formula: Reaction ~ Days + (1 | Subject)

   Data: sleepstudy
  AIC BIC logLik MLdeviance REMLdeviance  1792 1802 -893.2 1794 1786

> summary(fm2)

Linear mixed-effects model fit by REML
Formula: Reaction ~ Days + (Days | Subject)

   Data: sleepstudy
  AIC BIC logLik MLdeviance REMLdeviance  1754 1770 -871.8 1752 1744

> anova(fm1, fm2)
Data: sleepstudy
Models:
fm1: Reaction ~ Days + (1 | Subject)
fm2: Reaction ~ Days + (Days | Subject)

    Df     AIC     BIC  logLik  Chisq Chi Df Pr(>Chisq)    
fm1  3 1800.10 1809.68 -897.05                             
fm2  5 1761.98 1777.95 -875.99 42.115      2  7.158e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

> sessionInfo()
R version 2.4.0 (2006-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" [7] "base" other attached packages: vegan lme4 Matrix lattice "1.8-3" "0.9975-6" "0.9975-3" "0.14-9" ______________________________________________ R-help@stat.math.ethz.ch 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 Thu Oct 19 06:23:49 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 18 Oct 2006 - 21:30:10 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.