[R] degrees of freedom (lme4 and nlme)
Douglas Bates
bates at stat.wisc.edu
Wed Sep 1 13:50:07 CEST 2004
Alexandre Galvão Patriota wrote:
> Hi, I'm having some problems regarding the packages
> lme4 and nlme, more specifically in the denominator
> degrees of freedom. I used data Orthodont for the two
> packages. The commands used are below.
>
> require(nlme)
> data(Orthodont)
>
> fm1<-lme(distance~age+ Sex,
> data=Orthodont,random=~1|Subject, method="REML")
>
> anova(fm1)
>
> 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
>
>
> The DenDF for each fixed effect is 80, 80 and 25.
> Using the package lme4:
>
> require(lme4)
> data(Orthodont)
>
> fm2<-lme(distance~age+ Sex,
> data=Orthodont,random=~1|Subject, method="REML")
>
> anova(fm2)
>
> numDF Sum Sq Mean Sq DenDF F-value p-value
> age 1 235.356 235.356 105 114.838 <2.2e-16
> Sex 1 19.044 19.044 105 9.292 0.002912
>
>
> In this case the DenDF for each fixed effect is 105
> and 105. In this example, the conclusions are still
> the same, but it's not the case with another dataset I
> analyzed.
> I experience the same type of problem when using
> glmmPQL of the MASS package and the GLMM of package
> lme4. Could anyone give me a hint on why the two
> functions are giving incompatible results?
> thank you in advance for your help
The lme4 package is under development and only has a stub for the code
that calculates the denominator degrees of freedom.
These Wald-type tests using the F and t distributions are approximations
at best. In that sense there is no "correct" degrees of freedom. I
think the more accurate tests may end up being the restricted likelihood
ratio tests that Greg Reinsel and his student Mr. Ahn were working on at
the time of Greg's death.
More information about the R-help
mailing list