Pontarelli, Brett
2006-Feb-01 01:57 UTC
[R] Removing specific v1:v2 combinations from a formula.
Suppose I have a formula mfTest = (y ~ a + b + c + d1 + d2 + d3); When I update the formula mfTest2nd = update(mfTest, .~.^2); I get all the combinations a:b, a:c, etc. But I don't want the d1:d2, d2:d3, etc. interactions. I've tried mfTest2nd = update(fmTest, .~.^2 - (d1+d2+d3)^2); But that removes the 1st order variables as well. Is there a way to remove (with minimal typing) the d_i:d_j interactions only? Thanks. --Brett