I am currently reviewing some work and have come across the following, which seems wrong to me. Two mixed models are fitted (in R) using lmer. The models are non-nested and are compared by likelihood-ratio tests. In short, here is a reproducible example of what I have:
set.seed(105)
Resp = rnorm(100)
A = factor(rep(1:5,each=20))
B = factor(rep(1:2,times=50))
C = rep(1:4, times=25)
m1 = lmer(Resp ~ A + (1|C), REML = TRUE)
m2 = lmer(Resp ~ B + (1|C), REML = TRUE)
anova(m1,m2)
As far as I can see, lmer is used to compute the log-likelihood and the anova statement tests the difference between the models using a chi-square with the usual degrees of freedom. This does not seem correct to me. If it is correct, does anyone know of any reference justifying this? I am aware of methods relying on simulations (Paper by Lewis et al., 2011) and the approach developed by Vuong (1989) but I do not think that this is what is produced here. I do not think that the use of the anova statement is correct.
anova()function in R does not compare the two models fitted under REML; it refits them using ML and then perform the test. Seelme4:::anova.merMod, which contains the linemods <- lapply(mods, refitML). (But you are still right thatanova()can’t be used to compare the two models, as they are not nested.) – Karl Ove Hufthammer Jan 29 '14 at 19:32anova.merMod()were nested or not, but it could be hard to do completely reliably/generally ... – Ben Bolker Jan 29 '14 at 23:45404 Not Found. – Randel Jan 30 '14 at 19:36