[R] lmList, tapply() and lm()

2008-02-15 Thread Marc Belisle
Howdee, *** I know that the lmList() function exists, yet I don't want to use it. *** Would anyone be kind enough to tell how I can apply the function lm() to each level of a given factor so to obtain the intercept and slope for each factor level within a matrix? For instance, suppose a

Re: [R] lmList, tapply() and lm()

2008-02-15 Thread Chuck Cleland
On 2/15/2008 11:00 AM, Marc Belisle wrote: Howdee, *** I know that the lmList() function exists, yet I don't want to use it. *** Would anyone be kind enough to tell how I can apply the function lm() to each level of a given factor so to obtain the intercept and slope for each factor

Re: [R] lmList, tapply() and lm()

2008-02-15 Thread Jonathan Baron
Here is an example I just did. I _LOVE_ lmList(). It is such a great convenience compared to the following. But right now it doesn't work for family=binomial, so I had to do it differently. This is not your example, but it should give you an idea. The [[5]] was because I was interested only