Monday, March 13, 2006

Interpreting Interactions

Daniel Bauer and Patrick Curran have written a paper called Probing interactions in fixed and multilevel regression: Inferential and graphical techniques in the journal Multivariate Behavioral Research which describes a method for probing interactions between continuous variables.

I'll illustrate this in SPSS, using the data file which is used to illustrate interactions in the book Applying regression and correlation. You can get it here (in SPSS format). The dataset comprises the number of books (on statistics) that students read, the number of lectures that they attended, and the final grade they got. To spoil the ending, both number of books they read and number of lectures they attended were positive predictors of final grade. However, in addition, there is an interaction between books and grade.

To discover this, we standardise the two predictor variables and multiply them together to create the interaction variable. We then regress grade onto the standardised books, attendance and the interaction variables.

The results are shown in the following table:

Variable

B

Std. Error


p

Lower 95% CI

Upper 95% CI

Zscore(books)

5.951

2.403


.018

1.076

10.825

Zscore(attend)

5.702

2.404


.023

.827

10.578

Interaction

4.503

2.140


.042

.162

8.844


It's pretty clear that books has an effect, and attendance has an effect. We can interpret these in terms of standard deviations - we predict that a person who reads 1 SD more books will (controlling for attendance and the interaction term) achieve a grade that is 5.95 points higher. We predict that a person who attends 1 SD more lectures will achieve a grade that is 5.70 points higher.

And we predict something from the interaction term, but we aren't exactly sure what yet.

One way to see what we do predict from the interaction term is to 'pick a point'. Choose arbitrary values for attendance (say) plug them into the equation and see what happens.

Let's do that first. Because we don't like stuff to be hard, we will pick a low, medium and high number of attendances. The easiest way to do this is to use z-scores -1, 0 and 1, respectively.

Then, our equation looks like this:

Pred Grade = books * 5.95 + attendance * 5.70 + interaction * 4.50

We can expand this - because we know that the interaction is equal to books * attendance

Pred Grade = books * 5.95 + attendance * 5.70 + books * attendance * 4.50

Now we just stick -1, 0 or 1 into attendance, for a low medium and high attender.

Low (-1)
Pred Grade = books * 5.95 + -1* 5.70 + books * -1 * 4.50

Notice a couple of times we multiply a value by -1. Multiply those out.

Pred Grade = books * 5.95 + -5.70 + books * -4.50

Now notice that we have boos * 5.95 + books * -4.50 - that makes books * (5.95 - 4.50) which makes books * 1.45

Pred Grade = books * 1.45 + -5.70

And, as we aren't interested in the constant, we can lose anything that's not multiplied by books.
Pred Grade = books * 1.45

Same again for medium (this one's easier, because we just multiple by zero a lot).
Pred Grade = books * 5.95 + 0* 5.70 + books * 0 * 4.50
Pred Grade = books * 5.95

Same again for high:
Pred Grade = books * 5.95 + 1* 5.70 + books * 1 * 4.50
Pred Grade = books * 10.45

So, if you don't attend many lectures, reading another SD of books is going to help you a bit, but only a bit - your predicted grade only goes up by 1.45. If you are a moderate attender, you increase your predicted grade by 5.95 for the same number of books, and if you are a high attender, your predicted grade increases by 10.45 for the same number of books. (Notice that we are always saying predicted grade - we don't know that this is the cause).

This is all well and good, but we might want stuff like p-values on these, or standard errors, or confidence intervals. We might say that for the low attender the relationship isn't even statistically significant - reading more books doesn't help (because the low attenders might read the wrong books). This is where Bauer and Curran's paper comes in.

I'm not going to go into the nitty gritty. I'm just going to show what you can do with it. I'm going to use some calculators that you can find here. (But in the future, it looks like they might be here, and I'll probably forget to change this.)

The most exciting piece of output is this graph (and the tools on the web let you draw it; click on the graphs for bigger, clearer images).


The graph shows, on the x-axis, the (z-score of) the number of lectures attended by the student. On the y-axis is the simple slope of the (z-score of) books read. We evaluated that slope at -1, 0 and +1. We could do that by looking at those positions on the x-axis, tracking up to the black like, and reading off the values on the y-axis. The values appear to be where we said they would be - I've drawn in the lines on the next chart - remember our earlier calculations showed that they should be at 1.45, 5.95 and 10.45.


However the more exciting thing is the red lines. These show the confidence intervals around the slope. We said that if lecture attendance was low, we might expect that the effect of reading more books was not statistically significant. This does appear to be the case - the confidence intervals of the slope include 0 when the number of lectures attended is low.
Finally, the vertical dotted line shows the (z) value of lectures at which the p-value of the slope becomes statistically significant. This line appears at -0.21. In other words, if the z-score of the number of books read is below -0.21, we do not have evidence that reading more books will help improve the person's predicted grade.