All, I am looking for an efficient way to do the following in R.
I have a list of R GLM objects G
that all use the same model matrix X
. Each GLM object just corresponds to a different response variable Y1... Yp
.
I would like to create a summary list S
such that S[[i]]
is a data frame with the p
^th row containing the summary(G[[p]])$coefficients[i,]
for the p
response variables in each row. Thus, the length of list S
, length(S)
, will correspond to the total number of columns in X
. The number of rows of S[[i]]
, nrow(S[[i]])
, will equal the number of response variables.
Currently, I am running summaries for each object, and then extracting corresponding to each column in X. So I am wondering if there is a more efficient way to approach this.