Re: [R] Linear regression using matrices

2012-01-04 Thread Mark Sanderson
OK thanks. In my case I think it might be possible to work around this by reshaping my data and then using lmlist() to run separate regressions for each data group. lmlist() is new to me but it looks like it will do the job. -- View this message in context: http://r.789695.n4.nabble.com/Linear-

Re: [R] Linear regression using matrices

2012-01-04 Thread iliketurtles
I've done a lot of research on this very topic and found a few solutions. But all the ways I've discovered involve loops. Applying it to what you want, the best way I've found is to do (stolen from an experienced R user, of course): y<-array(rnorm(100),dim=c(10,10)) x<-array(rnorm(100),dim=c(10,1

[R] Linear regression using matrices

2012-01-04 Thread Mark Sanderson
I'm new to R and I'm not a Statistician I'm an Accountant, but I'm finding it an excellent tool for the business analysis work I do. I need to run LM() where both response and predictor are held in matrices. The model follows the form:- regression1 = matrix1.col1 <-> matrix2.col1 regression2 = mat