I programmatically evaluated several models, whose names are in a vector models
. How can I then use the function mtable
with them, calling them programmatically?
Here is an example :
library(memisc)
a <- rnorm(100,0,1)
b <- rnorm(100,0,1)
c <- rnorm(100,0,1)
d <- rnorm(100,0,1)
mod1 <- lm(a ~ b)
mod2 <- lm(c ~ d)
models <- c("mod1", "mod2")
mtable(mget(models,envir=globalenv()))
I then get an error: "no method available for 'getSummary' for an object of class 'list'"
.
What can I do? I tried call
and do.call
but without success.