Re: [R] Regression using mapply?

2010-09-10 Thread Greg Snow
This really depends on why you want to do this and what results you want. If your main goal is to look at some basic tests, goodness of fit, then the add1 function may do everything you need. If you just want coefficient estimates then some basic matrix algebra will give those to you.

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,

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);