Re: [R] Regression using mapply?

2010-09-10 Thread Greg Snow
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Philipp Kunze Sent: Wednesday, September 08, 2010 5:35 AM To: R-help@r-project.org Subject: [R] Regression using mapply? Hi, I have huge matrices in which the response variable

Re: [R] Regression using mapply?

2010-09-09 Thread Gray Calhoun
Hi Philipp, I like to use something like lapply(2:10, function(j) lm.fit(cbind(1, DataMatrix[,j]), DataMatrix[,1])) for this sort of thing. I'd be curious to know if there are other approaches that are better. --Gray On Wed, Sep 8, 2010 at 4:34 AM, Philipp Kunze pku...@gwdg.de wrote: Hi,

[R] Regression using mapply?

2010-09-08 Thread Philipp Kunze
Hi, I have huge matrices in which the response variable is in the first column and the regressors are in the other columns. What I wanted to do now is something like this: #this is just to get an example-matrix DataMatrix - rep(1,1000); Disturbance - rnorm(900); DataMatrix[101:1000] -

Re: [R] Regression using mapply?

2010-09-08 Thread David Winsemius
On Sep 8, 2010, at 7:34 AM, Philipp Kunze wrote: Hi, I have huge matrices in which the response variable is in the first column and the regressors are in the other columns. What I wanted to do now is something like this: #this is just to get an example-matrix DataMatrix - rep(1,1000);