Lily
2003-Sep-01 01:06 UTC
[R] help for performing regressions based on combination of predictors
Dear All, I would like to perform linear regressions based on Y and all of the combinations of the five predictors, i.e.,(y,x1,x2),(y,x1,x3),....,(y,x1,x2,x4,x5),....,(y,x1,x2,x3,x4,x5). Is there any quick way to do it instead of repeat performing regressions for 31 times? Or, is there any method to manipulate the dataset into the 31 combinations? Thanks for your help!
Lily
2003-Sep-01 01:57 UTC
[R] help for performing regressions based on combination of predictors
Thanks! However, what I mean is performing 31 regressions based on the combinations of the predictors. I don't consider interaction in this case. So, the regressions are like lm(y~x1+x2) or lm(Y~x1+x2+x3),or lm(y~x1+x2+x4) ...etc. --- Patrick Connolly <p.connolly at hortresearch.co.nz> wrote:> On Sun, 31-Aug-2003 at 06:06PM -0700, Lily wrote: > > |> Dear All, > |> > |> I would like to perform linear regressions based > on Y > |> and all of the combinations of the five > predictors, > |> >i.e.,(y,x1,x2),(y,x1,x3),....,(y,x1,x2,x4,x5),....,(y,x1,x2,x3,x4,x5).> |> > |> Is there any quick way to do it instead of repeat > |> performing regressions for 31 times? Or, is there > > |> any method to manipulate the dataset into the 31 > |> combinations? > > Probably, but it's simpler to put them all in the > formula: > > lm(y ~ x1 * x2 * x3 * x4 *x5) > > > -- > Patrick Connolly > HortResearch > Mt Albert > Auckland > New Zealand > Ph: +64-9 815 4200 x 7188 >~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~> I have the world`s largest collection of seashells. > I keep it on all > the beaches of the world ... Perhaps you`ve seen it. > ---Steven Wright >~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
kjetil brinchmann halvorsen
2003-Sep-01 02:10 UTC
[R] help for performing regressions based on combination of predictors
On 31 Aug 2003 at 18:06, Lily wrote: Have you tried library(leaps) library(help=leaps) ? Kjetil Halvorsen> Dear All, > > I would like to perform linear regressions based on Y > and all of the combinations of the five predictors, > i.e.,(y,x1,x2),(y,x1,x3),....,(y,x1,x2,x4,x5),....,(y,x1,x2,x3,x4,x5). > > Is there any quick way to do it instead of repeat > performing regressions for 31 times? Or, is there > any method to manipulate the dataset into the 31 > combinations? > > Thanks for your help! > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help