Have a look at lmList() in the nlme package. > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of JesperHybel > Sent: Friday, August 13, 2010 7:56 AM > To: r-help@r-project.org > Subject: Re: [R] Linear regression on several groups > > > Example is spot on - sr for not providing one myself. > The results you calculate are what I'm looking for. > > Would like a function F where I could type: > > F(weight ~ Time, data = ChickWeight, SOME ARGUMENT = Diet)) > > Resulting in > > for (i in 1:4){ > print( > > lm(weight ~ Time, data = ChickWeight, subset = Diet==i) > > ) > } > > I'm simply trying to minimize amount of looping and typing etc. > > BR Jesper > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Linear- > regression-on-several-groups-tp2322835p2324154.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.