On Fri, Jul 2, 2010 at 8:16 AM, Hadley Wickham <had...@rice.edu> wrote: >> ?formula in R 2.9.2 says in para 2: >> "The %in% operator indicates that the terms on its left are nested >> within those on the right. For example a + b %in% a expands to the >> formula a + a:b. " > > Ooops, missed that. So b %in% a = a:b, and that's what's meant by > "different coding".
Or would this be true only if "b %in% a" was preceded by "a"? attr(terms(y ~ B %in% A), 'term.labels') #[1] "B:A" attr(terms(y ~ B + B %in% A), 'term.labels') #[1] "B" "B:A" attr(terms(y ~ A + B %in% A), 'term.labels') #[1] "A" "A:B" suggesting a documentation buglet in Sec 11.1 of An Introduction to R, where it states: \begin{quote} y ~ A*B y ~ A + B + A:B y ~ B %in% A y ~ A/B Two factor non-additive model of y on A and B. The first two specify the same crossed classification and the second two specify the same nested classification. In abstract terms all four specify the same model subspace. \end{quote} I think "y ~ B %in% A" should be changed to "y ~ A + B %in% A" since attr(terms(y ~ A/B), 'term.labels') #[1] "A" "A:B" Or am I missing something? Kingsford > > Hadley > > -- > Assistant Professor / Dobelman Family Junior Chair > Department of Statistics / Rice University > http://had.co.nz/ > > ______________________________________________ > 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.