Brigadeiro
Brigadeiro

Reputation: 2945

Model formula for two-way interactions between one set of variables and another

I would like to specify all two-way interactions between a set of variables (e.g., a, b, and c) and one other (e.g., x). Is there a more efficient way to write the following formula?

Y ~ a*x + b*x + c*x

Upvotes: 0

Views: 24

Answers (1)

Brigadeiro
Brigadeiro

Reputation: 2945

The following does the trick:

Y ~ (a + b + c)*x

Upvotes: 0

Related Questions