[R-sig-ME] Fixed effects only model with lme4
rmh3093 at gmail.com
Sat Jun 6 20:45:09 CEST 2009
lmer requires a random effect's term so I doubt you can compare a lm
object to a lmer object
On 6/6/09, Jeroen Ooms <jeroenooms at gmail.com> wrote:
> 2009/6/6 Douglas Bates <bates at 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);
> Error in x$terms : $ operator not defined for this S4 class
> 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]]
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models