Re: [R] Multiple linear regression with for loop

2008-02-27 Thread bartjoosen
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 "Mühlbacher" wrote: > > Hi everyone! > > I have an array containing the

Re: [R] Multiple linear regression with for loop

2008-02-27 Thread Uwe Ligges
Markus Mühlbacher wrote: > Hi everyone! > > I have an array containing the following fields for over hundred compounds: > cpd, activity, fixterm, energy1, energy2, energy3, ... > > I want to run a multiple linear regression on all entries of an array. > Therefore I tried to do this with a fo

[R] Multiple linear regression with for loop

2008-02-26 Thread M�hlbacher
Hi everyone! I have an array containing the following fields for over hundred compounds: cpd, activity, fixterm, energy1, energy2, energy3, ... I want to run a multiple linear regression on all entries of an array. Therefore I tried to do this with a for loop. (Maybe there is a direct way of c