Re: [R] pairwise linear regression between two large datasets

2012-04-02 Thread stathisan
actually i figured it out: regRes[dim(regRes)[1]] should be regRes[dim(regRes)[1], ] -- View this message in context: http://r.789695.n4.nabble.com/pairwise-linear-regression-between-two-large-datasets-tp4527476p4527680.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] pairwise linear regression between two large datasets

2012-04-02 Thread jdnewmil
If "any idea of a for loop is disastrous," why are you using apply, which is basically a for loop? I think you have framed the question in such a way that loops are inevitable. You are already using the LHS as a matrix, which is the main speedup I could think of. However, you can avoid some s

[R] pairwise linear regression between two large datasets

2012-04-02 Thread Stathis Metsovitis
Hi all, I am trying to perform some analysis on the residuals of pair-wise linear regressions between two large sets A with dimensions {k x m}, and B {k x n} . So I need to regress every column B[,j] of B on every column A[,i] of A and produce a matrix C with dimensions {m x n}, so that C[i,j] cont