2009/6/6 Douglas Bates <bates@stat.wisc.edu>

>
>
> Try listing them the other way around
>
> anova(fm1, fm0)
>
> If the first model in the call to anova is of class "lm" then the
> method for that class is the one chosen and that method doesn't know
> about models created by lmer.  You must list them so that the lmer
> model comes first.


this still returns an error:
> fm0 <- lm(Reaction ~ Days, sleepstudy);
> fm1 <- lmer(Reaction ~ Days + (1|Subject), sleepstudy);
> anova(fm0,fm1);
Error in x$terms : $ operator not defined for this S4 class

> anova(fm1,fm0);
Error in FUN(X[[1L]], ...) :
  no slot of name "call" for this object of class "lm"

similar error if I use glm instead of lm.

	[[alternative HTML version deleted]]


