> attr(terms(~B*A), "term.labels")
[1] "B"   "A"   "B:A"
> attr(terms(~A/C), "term.labels")
[1] "A"   "A:C"
> attr(terms(~B*A/C), "term.labels")
[1] "B"     "A"     "B:A"   "B:A:C"
> attr(terms(~(B*A)/C), "term.labels")
[1] "B"     "A"     "B:A"   "B:A:C"
> attr(terms(~B*(A/C)), "term.labels")
[1] "B"     "A"     "A:C"   "B:A"   "B:A:C"
>

The issue is precedence of operations.  "*" has higher precedence than "/".

This is exactly the same issue you see in ordinary arithmetic
> 1+2*3
[1] 7
> (1+2)*3
[1] 9
>

Rich

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to