Re: [R] A easy way to write formula

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sun, 27 Jul 2008 14:41:57 -0500

On Sun, Jul 27, 2008 at 4:19 AM, Mark Difford <mark_difford_at_yahoo.co.uk> 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_ interaction terms, only
> interactions to the second order, so the interaction term x1:x2:x3 will be
> missing, To get these, do
>
> (x1 + x2 + x3)^3

Or just

x1 * x2 * x3

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help_at_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.
Received on Sun 27 Jul 2008 - 19:48:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 27 Jul 2008 - 20:34:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive