Skip to content
Prev 305410 / 398506 Next

remove all terms with interaction factor in formula

Your method would not work for, e.g., "a:d".  You could look at the "factors" attribute
of a terms object and select out those columns with non-zero entries for the variables
in the interaction of interest.  E.g.,
a b c d a:b a:c b:c a:d b:d c:d a:b:c a:b:d a:c:d b:c:d a:b:c:d
a 1 0 0 0   1   1   0   1   0   0     1     1     1     0       1
b 0 1 0 0   1   0   1   0   1   0     1     1     0     1       1
c 0 0 1 0   0   1   1   0   0   1     1     0     1     1       1
d 0 0 0 1   0   0   0   1   1   1     0     1     1     1       1
[1] "a"     "b"     "c"     "d"     "a:b"   "a:c"   "a:d"   "b:d"   "c:d"   "a:b:d" "a:c:d" 

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com