How to test for moderation? (part 1)

Let’s start by defining what moderation means in the context of a regression model or structural equation modeling (SEM). You have probably already tested for moderation without knowing that you were doing something that sounds so sophisticated, because moderation is nothing more than testing for an interaction between a predictor in your model and a covariate such as gender, age, years of experience, etc.

The word moderation is pretty self-explanatory. It means that a variable M moderates the relationship between two variables, a predictor (X) and a dependent variable (Y), in other words it can strengthen, weaken or even suppress the relationship between predictor (X) and study outcome (Y).


Examining the moderation effect entails assessing how the relationship between X and Y varies across the different values of the moderator (M). In order to illustrate how to measure moderation let’s consider the following linear regression model with one predictor, one moderator and their interaction term:


Y=b0 +b1X +b2M +b3XM + e


The levels of measurement of the predictor and moderator are key in the measurement of moderation. Depending on their nature, we can find four different scenarios: (1) both X and M are categorical, (2) both X and M are continuous, (3) X is continuous and M is categorical and (4) X is categorical and M is continuous.


Under scenario # 1, where both X and M are categorical, this is equivalent to measuring the interaction between two factors as in a two way ANOVA. If both X and M are dichotomous we are in front of what is known as 2×2 design. For instance, imagine we are interested in testing whether gender (1=female, 0=male) moderates the strength of an educational intervention (1=intervention, 0 =control) aimed to improving parenting skills. In our example b1 measures the effect of X on Y when the moderator equals 0, in other words the effect of the intervention among males, b2 measures the effect of being female (M=1) in the control group (X=0) and b3 measures the change in the effect of X when M goes from 0 to 1, in our example, the difference in the effect of the intervention in females compared to males.

If X and/or M have more than 2 levels then we will need to create as many dummies as the number of levels minus one and the interaction between X and M will be represented by a set of products between the dummies of each variable. To follow with our example, let’s imagine that we want to compare the effectiveness of two educational interventions and we still keep a control group. Our predictor X has now 3 levels and we will need to create two dummies which we code as: X1 (1= intervention A, 0=else) and X2 (1=intervention B, 0=else).

Therefore, our equation will look like:


Y=b0 +b1X1 +b2X2 +b3M +b4X1M + b5X1M + e


In this case, moderation can be tested using a hierarchical regression where X1, X2 and M are added in a first block and the product terms X1M and X2M are added in a second block. The p-value corresponding to the F change will determine whether there significant moderation. Alternatively we can specify the hypothesis test that the coefficients on the interaction terms are jointly equal to 0 (b4=0; b5=0)


In my next post we will address the other 3 scenarios…to be continued

About raquelandres75

I am an statistician/researcher who has decided to make a living by dedicating myself to help others who struggle with statistics.
This entry was posted in moderation and tagged , , , , , , . Bookmark the permalink.

Leave a Reply