3
$\begingroup$

When we use anova() function to compare two or more models, what test is it actually performing? I don't think that's an "Anova" per si, right. Would it be a "a likelihood-ratio chi-squared test"* or anything else?

Example:

> mod1 <- lmer(Y ~ X1 * X2 + (1|ID), data = data, REML = F)
> mod2 <- lmer(Y ~ X1 + X2 + (1|ID), data = data, REML = F)

> anova(mod1, mod2)

Data: data
Models:
mod2: Y ~ X1 * X2 + (1 | ID)
mod1: Y ~ X1 + X2 + (1 | ID)
     npar    AIC    BIC  logLik deviance  Chisq Df Pr(>Chisq)    
mod2    5 51.649 63.803 -20.824   41.649                         
mod1    6 40.504 55.089 -14.252   28.504 13.144  1  0.0002884 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  • Question: What is the correct way to report this test? Thanks in advance!
  • follow-up: Is it ok to say "we assessed the model godness of fit by a a likelihood-ratio chi-squared test" ?
$\endgroup$
1

1 Answer 1

4
$\begingroup$

Based on the paper that presents the lme4 package you are correct, it is a chi-square test that the anova function will output when called with multiple models as arguments. More technically they say:

The output shows χ2 statistics representing the difference in deviance between successive models, as well as p values based on likelihood ratio test comparisons.

I don't know how to report this test because every field has its own traditions in presenting statistical tables results. However, the output gives some things that would be expected. P values for one, basic statistics like the AIC are known in some fields, or the deviance in others. I would check the literature to see how those are usually presented.

As for the last question, I wouldn't say that the chi-square statistic derived from the difference of the deviances of two candidate models would be a goodness of fit measure. Those usually rely solely on the residuals or deviance of a single model and on the asymptotic properties of those under the chosen model and comparing them with the saturated model (which is the model where there is one parameter for each observation). I would add a residual analysis as a good measure of goodness of fit as well.

$\endgroup$
2
  • $\begingroup$ I am a bit rusty on my regression analysis terminology, so I could be off in the last paragraph since I'm going solely based on memory. $\endgroup$ Commented Oct 14, 2022 at 2:50
  • $\begingroup$ thank you! how would you perform a "I would add a residual analysis as a good measure of goodness of fit as well" for lmers? $\endgroup$ Commented Oct 14, 2022 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.