Here you go:
sapply(fit,function(x) summary(x)$r.squared)
11 12
0.9657143 0.9657143
Or to do everything at once:
sumfun <- function(x) c(coef(x),summary(x)$r.squared)
t(sapply(fit,sumfun))
(you need to transpose the results from sapply
to get the table as specified above). Then use names() <-
or setNames()
to get the column names the way you want them.