Very different results with ezANOVA and LMER in R

I have a repeated-measures design, so I use ezANOVA. However, I was interested in a numeric (ordinal) predictor, so I ran two models: with ezANOVA (ez package) and lmer (lme4 + lmerTest). The results seem to be very different, so I don't think they can be attributed to the differences in parameters estimation in two models - unlike other questions on that topic here. For simplicity I left just that numeric predictor.

ez model:

> ezANOVA(data = mydata,
dv = rating,
wid = sbj,
within = .(block))
Warning: Converting "sbj" to factor for ANOVA.
Warning: "block" will be treated as numeric.
Warning: Collapsing data to cell means. *IF* the requested effects are a subset of the full design, you must use the "within_full" argument, else results may be inaccurate.
Warning: There is at least one numeric within variable, therefore aov() will be used for computation and no assumption checks will be obtained.
\$ANOVA
Effect DFn DFd        F         p p<.05        ges
1  block   1  79 1.025261 0.3143656       0.01281171


lmer model:

> anova(lmer(rating ~ block + (1|sbj), data = mydata))
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value   Pr(>F)
block 49.709  9.9419     5 14119   3.304 0.005524 **


Making block (6 levels) an ordered or a factor variable doesn't change much. What can be the reason for such different results?

It is well known that mixed models without the random slope associated with the fixed effect of interest are overly liberal. Roughly, this is because interindividual differences in the response to the independent variable are not modelled adequately.

Achieving exactly equivalent results with mixed models as with repeated measures ANOVA is not trivial, because the two approaches are based on different assumptions. I believe the closest approximation of ezANOVA through lmer is given by

lmer(rating~block+(1|sbj)+(1|sbj:block), data=mydata)


A valid alternative approach would be

lmer(rating~block+(block|sbj), data=mydata)


Maybe you also find this question+thread informative: Repeated measures analysis: why nest experimental factors within subject factor?

• Hi Lucas! Thanks for your answer! Indeed, a second option (including random slope) makes the results very close to rm-anova. I was pretty sure that the closest lmer-analogue to rm-anova is random-intercept model... So, am I right that in this situation, I better trust rm-anova results, concluding that block isn't a significant predictor of rating? Jul 30 '20 at 13:02
• Yes, this appears to be the most supported conclusion! Jul 30 '20 at 13:13