Re: [R] A easy way to write formula

2008-07-27 Thread hadley wickham
On Sun, Jul 27, 2008 at 4:19 AM, Mark Difford <[EMAIL PROTECTED]> wrote: > > Hi Jinsong and Thierry, > >>> (x1 + x2 + x3) ^2 will give you the main effects and the interactions. > > Although it wasn't specifically requested it is perhaps important to note > that (...)^2 doesn't expand to give _all_

Re: [R] A easy way to write formula

2008-07-27 Thread Mark Difford
Hi Jinsong and Thierry, >> (x1 + x2 + x3) ^2 will give you the main effects and the interactions. Although it wasn't specifically requested it is perhaps important to note that (...)^2 doesn't expand to give _all_ interaction terms, only interactions to the second order, so the interaction term

Re: [R] A easy way to write formula

2008-07-27 Thread ONKELINX, Thierry
(x1 + x2 + x3) ^2 will give you the main effects and the interactions. So this will shorten your equation to ft <- lm(y ~ (x1 + x2 + x3) ^2 + I(x1 * x1)+ I(x2 * x2) + I(x3 * x3), mydata) HTH, Thierry ir. Thierry Onke