Re: [R] linear model and by()

2009-11-14 Thread David Winsemius
On Nov 13, 2009, at 11:49 AM, Sam Albers wrote: Hello R list, snipped answered question Sorry to not use your data but it's not in a form that lends itself very well to quick testing. If you had included the input commands I might have tried it. No problem not use my data. For futur

Re: [R] linear model and by()

2009-11-13 Thread Ista Zahn
On Fri, Nov 13, 2009 at 11:49 AM, Sam Albers wrote: > No problem not use my data. For future reference, would it have been easier > to attach a .csv file and then include the appropriate read.csv command? I > realized that the easier one makes it to help, the easier it is to get a > response. > >

Re: [R] linear model and by()

2009-11-13 Thread Sam Albers
> Hello R list, >> >> This is a question for anyone who has used the by() command. I would like >> to >> perform a regression on a data frame by several factors. Using by() I >> think >> that I have able to perform this using the following: >> >> lm.r <- by(master, list(Sectionf=Sectionf, startd=s

Re: [R] linear model and by()

2009-11-12 Thread David Winsemius
On Nov 12, 2009, at 8:26 PM, Sam Albers wrote: Hello R list, This is a question for anyone who has used the by() command. I would like to perform a regression on a data frame by several factors. Using by() I think that I have able to perform this using the following: lm.r <- by(master, l

Re: [R] linear model and by()

2009-11-12 Thread Ista Zahn
Hi, You have not given us all the data needed to reproduce your analysis (what is SectionF?), but the issue is probably that lm.r is a list and you're not treating it that way. Try srt(lm.r) and summary(lm.r[[1]]) You may also want to look at the the lmList() function in the lme4 package. -Ist

[R] linear model and by()

2009-11-12 Thread Sam Albers
Hello R list, This is a question for anyone who has used the by() command. I would like to perform a regression on a data frame by several factors. Using by() I think that I have able to perform this using the following: > lm.r <- by(master, list(Sectionf=Sectionf, startd=startd), function(x) lm