Skip to content
Prev 12510 / 20628 Next

anova (lm, lmer ) question

OK got it.  I had thought we might be saying a mixture-of-chi-square approach was implemented, for testing on a boundary. 

I have been led to believe the approach is conservative.  Anyway, will spend some time with the FAQ (thanks).

I acknowledge the point make previously, that variances may be included based on design and testing them obviated.  


-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Ben Bolker
Sent: Monday, October 06, 2014 12:53 PM
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] anova (lm, lmer ) question
On 14-10-06 12:36 PM, Farrar, David wrote:
I didn't mean to imply that anova(m.ML,m.lm) would actually work, but rather that the equivalent calculation would be appropriate, e.g.

    library(lme4)
    fm1 <- lmer(Reaction ~ Days + (1 | Subject), sleepstudy, REML=FALSE)
    fm0 <- lm(Reaction ~ Days, sleepstudy)
    NL1 <- -logLik(fm1)
    NL0 <- -logLik(fm0)
    devdiff <- 2*(NL0-NL1)
    dfdiff <- attr(NL1,"df")-attr(NL0,"df")
    pchisq(devdiff,dfdiff,lower.tail=FALSE)

The p-value is very small in this case, but that's consistent with a large/well-determined variance estimate ...

    pp <- profile(fm1)
    library(lattice)
    xyplot(logProf(pp))

Keep in mind that the likelihood ratio test also has some theoretical problems in this case, mainly with boundary issues (see http://glmm.wikidot.com/faq for more info)
_______________________________________________
R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models