Removing specific v1:v2 combinations from a formula.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Removing specific v1:v2 combinations from a formula.

Pontarelli, Brett
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html