Skip to content
Prev 280902 / 398503 Next

Other ways to lm() regression? (non-loop?)

Dear anonymous:

1. You may be more likely to get "useful tips" on this list if you
sign with your real name. It's friendlier.

2. If you are using R "14 hours/day." get and read a good R book. The
CRAN site or Amazon lists many; choose one or more that suits your
needs.

3. Read the R Help files carefully.  ?lm tells you that you do not
need a loop to fit many y's simultaneously:

"If response is a matrix a linear model is fitted separately by
least-squares to each column of the matrix. "

4. Loops are not necessarily so terrible. "apply" type functions are
basically loops, also; their chief advantage is often just code
readability, not efficiency.

5. For tasks such as yours, ?update methods are typically useful.

Cheers,
Bert
On Mon, Dec 26, 2011 at 4:29 AM, iliketurtles <isaacm200 at gmail.com> wrote: