I used lm() to match multiple regression models, for multiple (~ 1 million) response variables in R. For example.
allModels <- lm(t(responseVariablesMatrix ~ modelMatrix)
Returns an object of class "mlm", which looks like a huge object containing all the models. I want to get the Residual Sum of Squares for each model that I can do using:
summaries <- summary(allModels) rss1s <- sapply(summaries, function(a) return(a$sigma))
My problem is that I think that the "summary" function also computes the totality of other things and therefore is pretty slow. I am wondering if there is a faster way to extract only the Residual Sum of Squares for the model?
Thanks!
source share