[R] Anova over a list of models
    Jeroen Ooms 
    j.c.l.ooms at uu.nl
       
    Sat Sep  5 22:43:22 CEST 2009
    
    
  
2009/9/5 Henrique Dallazuanna <wwwhsd at gmail.com>
>
> 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) :
  'names' attribute [6] must be the same length as the vector [2]
> do.call(anova, myModels)
Error in as.character.default(X[[1L]], ...) :
  no method for coercing this S4 class to a vector
    
    
More information about the R-help
mailing list