Skip to content
Prev 137780 / 398498 Next

Multiple linear regression with for loop

I'm not sure if this is what you want but if you have a matrix as response,
you can use the matrix ~ term:
example:
x <- 1:10
y <- rep(rnorm(10,x,0.5),10)
dim(y) <- c(10,10)
y <- as.matrix(y)
coef(lm(y~x))


Bart
Markus &quot;M?hlbacher&quot; wrote: