Tuesday, February 5, 2008

Basic Considerations for Modeling Interaction Terms

Some recent discussions in the hallways about modeling interaction terms leads me to put this post up. Interaction terms in regression models can capture many types of joint relationships, particularly when you work with terms that span negative and positive values. Here are some basic examples that show what you can do:


  • Interaction term with components that take only positive values. Suppose you have x1 = 1, 2, or 3 and x2 = 1, 2, or 3. Then interaction term, x1*x2 takes values ranging from 1 to 9. The interaction term thus orders observations on the number line in a manner that increases in the same way for both terms. If all values are negative, then the logic is the same, but the ordering is in the opposite direction on the number line. This is the basic case.

  • Interaction term with components that each take positive and negative values. Suppose you have x1 = -1,0, or 1 and x2 = -1, 0, or 1. Then x1*x2 takes values ranging from -1 to 1. The interaction term thus orders observations on the number line according to congruity of direction relative to zero. This type of interaction is useful for theories proposing that congruity of some sort determines the magnitude of an effect. As a basic example, suppose you are modeling amount of legislation passed in a year by a state government as determined by party vote shares in the state assembly and the party of the governor. You could code years with a Democratic governor as 1 and a Republican governor as -1, and then subtract .5 from the Democratic voteshare in Congress, in which case you are left with positive values when the Democrats have a majority and negative values when the Republicans have a majority. Interacting these two terms would result in positive values when the governor and assembly are controlled by the same party, and negative values when there is divided party government.

  • Interaction term with one component always positive and the other spanning positive and negative values. Suppose you have x1 = -1, 0, or 1, and x2 = 1, 2, or 3. Then x1*x2 takes values ranging from -3 to 3. In this case, x1 determines the direction of the joint effect, but x2 determines the magnitude. If x1 included values other than -1 and 1, x1 would both determine the direction and contribute to the magnitude of the joint effect. This could represent some kind of mediating effect.


So, as you can see, there are substantially different qualitative implications to having interaction terms with components that span positive and negative values. Just something to keep in mind.

1 comment:

Andrew Gelman said...

Hi, Cyrus. I just noticed this. It's usual to subtract the mean values from the main effects first. We discuss this in chapter 3, I think (look under "interactions").