2

I have a data set where where I manipulated two continuous predictors (B/A and B/C), a dichotomous predictor (Mag, effects coded[-1 1]), and measured participants' baseline SVO level as a continuous predictor. As it turns out, I have several interaction effects:

B/A * Mag

B/C * Mag

B/A * B/C * SVO

My question is: how do I interpret the interaction effects with Mag? For instance, is B/A * Mag the effect of B/A at mag(-1) across levels of B/C and SVO? Or, is B/A * Mag the effect of B/A at Mag(-1) when B/C and SVO equal 0? I assume whichever is correct would also apply to the B/C x Mag interaction.

Thank you for your help!

aarsmith
  • 63
  • 4

1 Answers1

3

With an interaction, the big problem is interpreting the lower-order coefficients.

For simplicity let's call your continuous "B/A", "B/C" and "SVO" simply "A" and "C" and "S", and call "Mag," your dichotomous predictor, "M". As lower-order terms should be included along with interactions, your regression model then would be:

outcome ~ A + C + S + M + A:M + C:M + A:C + A:S + C:S + A:C:S

Here, I've used ":" to represent interaction terms specifically without their lower-order terms, following R syntax in which an interaction term written "A*C*S" is automatically expanded into all lower-order terms.

Coefficients for the terms in a regression model--whether the intercept, for individual predictors, or for interactions--are typically reported for a situation in which all predictors other than those in that term are at values of 0. For A, M, and the A:M interaction you will get: coefficient $\beta_A$ for A when all of C, S, and M are at 0; coefficient $\beta_M$ for M when all of A, C, and S are at 0; coefficient $\beta_{A:M}$ for the A:M interaction when C and S are at 0. There are a couple of things to note.

First, unless your software has a special way of treating a categorical predictor coded as {-1,+1}, the value of M=0 for which the intercept and values of coefficient of other predictors might be reported doesn't represent any actual value of M. You might run less of a risk of misinterpretation if you code it as {0,1} instead (as R does). Then it's clear that coefficients for other predictors are reported at whichever reference level of M you have chosen to be coded as 0.

Second, if a predictor is included in an interaction term, the coefficients reported for the predictors with which it interacts will necessarily be affected by how you code that particular predictor. You can get different values for the terms involving A and B, depending on whether you use S in its original scale or center it to a mean of 0, or whether you change the reference level of M.

The interaction coefficient themselves are, perhaps counter-intuitively, less affected by the coding. For example, the A:M interaction coefficient $\beta_{A:M}$ represents how much the effect of A changes per unit change in M, and vice-versa, with all other predictors held constant. Whether A is in its initial scale or is centered to 0, that change per unit change will be the same (although you must watch out for what a "unit change" means if you code a categorical predictor as {-1,+1}), and the values of C and S don't matter as they are held constant. My answer here illustrates this phenomenon.

So work through those principles for all of your model's terms. It will take some patience but then you will have a better understanding of just what each of the model coefficients represents.

Application to example from the question:

The question asks (replacing "Mag(-1)" with "the reference Mag level" to avoid potential ambiguities with coding noted above):

is B/A * Mag the effect of B/A at [the reference Mag level] across levels of B/C and SVO? Or, is B/A * Mag the effect of B/A at [the reference Mag level] when B/C and SVO equal 0?

The answer, based on the above, is neither. The second possibility actually is the interpretation presented above of the individual coefficient for "B/A" in the interaction model ($\beta_A$ in my terminology), when the interaction is expanded into its individual and interaction-specific terms. The interaction-specific coefficient ("$\beta_{A:M}$" in my terminology) is how much that relationship between outcome and "B/A" changes when "Mag" takes on its other value. Furthermore, in this example, that interaction-specific term does not involve either "B/C" or "SVO" so there isn't really a distinction between those two possibilities.

For display, I usually find it simplest and best to plot predictions and their confidence intervals for example cases, rather than trying to use individual data points. Individual data points are hard to evaluate in a logistic regression in any event, as the individual outcomes are either 0 or 1. To illustrate the interaction between "B/A" and "Mag," I would choose representative values of "B/C" and "SVO" and plot, using those representative values, the predicted log-odds of the outcome (and associated confidence bands) as a function of "B/A" separately for both levels of "Mag."

EdM
  • 57,766
  • 7
  • 66
  • 187
  • Thanks for your comment; as I read it, it seems to support my latter interpretation. As a follow-up, I want to plot the effects of the A:M interaction by having A on the x axis and two separate lines for M with individual data points to show the error space. However, to do so I originally collapsed over all values of C and S - my hunch this is incorrect. As every person only has 1 value of S, I imagine i should only include individual data points from when S and C = 0. Do you agree? I hope my explanation made sense. – aarsmith Sep 30 '20 at 21:27
  • @aarsmith I've added some more to the end of the answer to address the points you raised. Interactions take a lot of thinking through to get right when you first encounter them. – EdM Oct 01 '20 at 14:00
  • thank you again for the helpful response, and I agree with your direction. However, after trying to google a solution, I am unsure of how I could plot confidence bands around my estimates (I am currently using Matlab glmefit). I am using a mixed logistic, which sounds like it is more complicated than simple linear regression. Additionally, how would I be able to plot confidence bands for my three way interaction A*C*S given that it is the combination of so many betas. Additionally, each individual only has one value of S. Sorry for more questions but really appreciate your help! – aarsmith Oct 01 '20 at 15:07
  • @aarsmith software-specific questions are off-topic here. In general, software provides some type of `predict()` function that allows for plotting predictions along with confidence intervals. Check Matlab help sites for how to do this with that software. Yes, this gets more complicated when there are mixed models; see [here](https://stats.stackexchange.com/a/174227/28500) for an example. It's usually simplest just to show predictions at the mean levels of the random effects, particularly if your interest is just to illustrate the interaction of a continuous and a categorical predictor. – EdM Oct 01 '20 at 15:18
  • @aarsmith three-way interactions are particularly difficult to display along with confidence intervals. Again, well-chosen illustrative examples are probably the best. Otherwise, one hopes that the tabular display of coefficients and confidence intervals makes the point. – EdM Oct 01 '20 at 15:22
  • Great answer, @EdM. There are some great packages in R for visualizing interactions based on marginal effects. One is `effects`, another is `emmeans`, and the one I prefer is `ggeffects`. These can be immeasurably helpful as you try understand your interaction. – Erik Ruzek Oct 01 '20 at 15:48