[R] different DF in package nlme and lme4

Christoph Buser buser at stat.math.ethz.ch
Mon Jan 3 12:18:18 CET 2005


Hi all

I tried to reproduce an example with lme and used the Orthodont
dataset.

library(nlme)
fm2a.1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1 | Subject)
anova(fm2a.1)
>             numDF denDF  F-value p-value
> (Intercept)     1    80 4123.156  <.0001
> age             1    80  114.838  <.0001
> Sex             1    25    9.292  0.0054

or alternatively (to get the same result)

fm2a.2 <- lme(distance ~ age + Sex, data = Orthodont, random = list(Subject = ~ 1))
anova(fm2a.2)
>             numDF denDF  F-value p-value
> (Intercept)     1    80 4123.156  <.0001
> age             1    80  114.838  <.0001
> Sex             1    25    9.292  0.0054

---------------------------------------------------------------
Then I restarted!!! R to use the lme4 package instead of nlme.
---------------------------------------------------------------

library(lme4)
fm2b.1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1 | Subject)
anova(fm2b.1)
> Analysis of Variance Table
>     Df  Sum Sq Mean Sq   Denom  F value    Pr(>F)    
> age  1 235.356 235.356 105.000 114.8383 < 2.2e-16 ***
> Sex  1  19.044  19.044 105.000   9.2921  0.002912 ** 

or alternatively (to get the same result)

fm2b.2 <- lme(distance ~ age + Sex, data = Orthodont, random = list(Subject = ~ 1anova(fm2b.2)
> Analysis of Variance Table
>     Df  Sum Sq Mean Sq   Denom  F value    Pr(>F)    
> age  1 235.356 235.356 105.000 114.8383 < 2.2e-16 ***
> Sex  1  19.044  19.044 105.000   9.2921  0.002912 ** 


I got different DF for the denominator. Do I have to use lme in
another way in the package lme4?

I use R 2.0.1 under linux and
Package:       nlme
Version:       3.1-53
Date:          2004-11-03
Package:       lme4
Version:       0.6-11
Date:          2004-12-16

Thanks for help.

Regards, 

Christoph Buser

-- 
Christoph Buser <buser at stat.math.ethz.ch>
Seminar fuer Statistik, LEO C11
ETH (Federal Inst. Technology)	8092 Zurich	 SWITZERLAND
phone: x-41-1-632-5414		fax: 632-1228
http://stat.ethz.ch/~buser/




More information about the R-help mailing list