1

I'm using ANOVA to test for differences between different values of the same factor for a mixed effects model which I produced. My model is: m2 <- lmer (ovsize ~ d.sheetratio + (1|nid), REML=FALSE). Following this, I subsetted the data so that each separate model described just data values for just one value of ratio.

me <- lmer (eovsize ~ eratio + (1|nide), REML=FALSE)
md <- lmer (dovsize ~ dratio + (1|nidd), REML=FALSE)
mc <- lmer (covsize ~ cratio + (1|nidc), REML=FALSE)
mb <- lmer (bovsize ~ bratio + (1|nidb), REML=FALSE)
ma <- lmer (aovsize ~ aratio + (1|nida), REML=FALSE)

At this point I get an error message which states that 'fixed-effect model matrix is rank deficient so dropping 1 column / coefficient'. Then when I do the ANOVA to compare each (e.g. me vs. ma) I get an output which looks like this:

Data: 
Models:
mb: bovsize ~ bratio + (1 | nidb)
ma: aovsize ~ aratio + (1 | nida)
   Df     AIC     BIC logLik deviance Chisq Chi Df Pr(>Chisq)
mb  3 -323.05 -316.06 164.53  -329.05                        
ma  3 -235.34 -229.37 120.67  -241.34     0      0          1

How can $\chi^{2}$ be 1 when each model is different? Is there an error in the method that I've used? Also, is the error message I received important?

Nick Stauner
  • 11,558
  • 5
  • 47
  • 105
unknown
  • 137
  • 1
  • 11

1 Answers1

4

You've misread your output: $\chi^2$ is 0, and p = 1. This is because you've entered the better-fitting model first, and it's not clear that these are nested models. If you enter the worse-fitting model first, you'll get $\chi^2_{(0)}>0,p\approx0$, but this isn't really a proper test, because any $\chi^2_{(0)}>0$ will have a $p\approx0$. To have df > 0, your models must be nested. Non-nested models also pose some challenges for comparing AIC, as Ben Bolker mentions in comments here: Likelihood ratio test - lmer R - Non-nested models.

The error message usually indicates strong multicollinearity, though with only one fixed and random effect per model, I'm not sure why that would be. See What is rank deficiency, and how to deal with it? My guess is that you may have missing data problems, or too few observations per level of nidx, but when I try to simulate data with the latter problem, I get different errors, or none at all...

Nick Stauner
  • 11,558
  • 5
  • 47
  • 105