I am working in an analytical lab where a lot of data is generated. We do model fitting and are interested in model coefficients (intercept, a, b), r_squared and residual standard error. The number of up to 70 dependant variables (responses) is rather large. I would like to generate from mylms a table where the rows are the responses a to f and the columns the mentioned model parameters.
I was not able to adapt the solutions I found on the net to my case:
A part of the solution is surely summary(mylms) where the parameters are stored.
Here is the simplified example I would like to find a solution to:
#To generate a dataset
x <- c(1:30)
x2 <- x*x
a <- x2
b <- jitter(a, factor=10)
c <- jitter(b, factor=30)
d <- jitter(c, factor=40)
e <- jitter(d, factor=50)
f <- jitter(e, factor=60)
z <- cbind(a,b,c,d,e,f)
# The matrix y are the responses of x
y <- as.matrix(z)
# Define the weights for the regression
w <- 1/x
# create linear models
mylms <- lm(y~x+x2, weights=w)