Jeroen
This seems to work for (1):
anova(myModels[[1]], force(myModels[[2]]))
OR
anova(myModels[[1]], (myModels[[2]]))
I suspect this is about lazy-evaluation, looking at the source code
for anova for mer objects: selectMethod("anova","mer"), something goes
wrong with the sapply to get the names,
2009/9/5 Henrique Dallazuanna
>
> Try this:
> anova(myModels[[1]],myModels[[2]])
>
> do.call(anova, myModels)
Does this work for you? Both functions are failing here:
> anova(myModels[[1]],myModels[[2]])
Error in names(mods) <- sapply(as.list(mCall)[c(FALSE, TRUE, modp)],
as.character) :
'name
Try this:
1)
anova(myModels[[1]],myModels[[2]])
2)
do.call(anova, myModels)
On Sat, Sep 5, 2009 at 5:18 PM, Jeroen Ooms wrote:
>
> I have a list object, in which I have stored n lme4-models. For example:
>
> library(lme4);
> myModels <- list();
> myModels[1] <- lmer(Reaction ~ Days + (Days|Sub
I have a list object, in which I have stored n lme4-models. For example:
library(lme4);
myModels <- list();
myModels[1] <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
myModels[2] <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject),
sleepstudy)
Now I would like to perform an anova ove
4 matches
Mail list logo