Many thanks, works great!
Charilaos Skiadas-3 wrote:
Try this:
lapply( 1:2, function(i) lm( y~x, data=list(x=xdat[,i], y=ydat[,i]) ) )
Haris Skiadas
--
View this message in context:
http://www.nabble.com/Using-lm-with-a-matrix--tp17708207p17829661.html
Sent from the R help mailing
I'm trying to do a linear regression between the columns of matrices. In
example below I want to regress column 1 of matrix xdat with column1 of ydat
and do a separate regression between the column 2s of each matrix. But the
output I get seems to give correct slopes but incorrect intercepts and
On Jun 7, 2008, at 8:13 AM, jonboym wrote:
I'm trying to do a linear regression between the columns of
matrices. In
example below I want to regress column 1 of matrix xdat with
column1 of ydat
and do a separate regression between the column 2s of each matrix.
But the
output I get
3 matches
Mail list logo