PSYC 3032 M
️
Me: I’m going to make one of those diagrams with overlapping circles
Dracula: Venn
Me: I don’t know, probably tomorrow
Introduction to Interaction
Interaction is moderation, these terms are synonymous
If two variables are said to interact (i.e., there’s an interaction between two variables), it means that the relationship between one predictor, \(X\), and the outcome variable, \(Y\), depends on the level of another predictor, \(Z\)
Another way to say it: in the presence of an interaction, the relationship between \(X\) and \(Y\) is different (or varies) for different values of \(Z\)
“In general terms, a moderator is a qualitative (e.g., sex, race, class) or quantitative (e.g., level of reward) variable that affects the direction and/or strength of the relation between an independent or predictor variable and a dependent or criterion variable.”
— Baron & Kenny, 1986
Do Younger and Older Adults Equally Benefit from Physical Activity?
Suppose the relation between physical activity (\(X\)) and cognitive performance (\(Y\)) varies according to age group (i.e., younger adults, middle-aged adults, and older adults), such that the effect of physical activity on cognitive performance is much stronger with older age
Then we would say that age group moderates the association between physical activity and cognitive performance
Do Younger and Older Adults Equally Benefit from Physical Activity?
Do Younger and Older Adults Equally Benefit from Physical Activity?
Do Younger and Older Adults Equally Benefit from Physical Activity?
We often refer to \(X\) as a focal predictor and \(Z\) as the moderator, but the choice is arbitrary
Moderation is very common in psychology; In fact, you’ve probably already done a moderation analysis before! Factorial ANOVAs, which is commonplace in experimental designs, is an example of moderation
In a two-way ANOVA, the model includes two categorical predictor variables and a continuous outcome variable (you could also include a three-way interaction by including three categorical predictors and testing how the three variables interact, but that’s often harder to interpret)
However, factorial ANOVA requires that all predictors are categorical, which is a real limitation
Including a moderation in a regression framework is much more flexible, whereby you can have categorical variables, continuous variables, and their combination
Recall, an MLR model with two predictors (no interaction), looks like this:
\[\hat{y}_i= \beta_0 + {\color{darkcyan} {\beta_1}}X_i+{\color{darkcyan} {\beta_2}}Z_i\]
\[\hat{Cognitive \ performance}_i= \beta_0 + {\color{darkcyan} {\beta_1}}Physical \ activity_i+{\color{darkcyan} {\beta_2}}Age \ group_i\]
\[\hat{y}_i= \beta_0 + {\color{darkcyan}{\beta_1}}X_i + {\color{darkcyan}{\beta_2}}Z_i + {\color{deeppink} {\beta_3}}X3_i = \\ \hat{y}_i = \beta_0 + {\color{darkcyan}{\beta_1}}X_i + {\color{darkcyan}{\beta_2}}Z_i + {\color{deeppink} {\beta_3}}(X_i \times Z_i)\]
\[\hat{Cognitive}_i = \beta_0 + {\color{darkcyan}{\beta_1}}Activity_i + {\color{darkcyan}{\beta_2}}Age_i + {\color{deeppink}{\beta_3}}(Activity_i \times Age_i)\]
Specifying a moderation model involves estimating main effects and an interaction
Because an interaction implies that the relationship between the focal predictor and outcome changes at different levels of the moderator, researchers typically follow up a moderation model by examining simple effects (often called “probing” an interaction)
A simple effect is the magnitude of the relationship between the focal predictor and outcome variable at a particular level of the moderator; e.g., the strength of association between physical activity and cognitive performance only for older adults
Parental alcoholism, externalizing behaviours, and alcohol use
A researcher believes that parental alcoholism moderates the relationship between adolescents’ externalizing behaviours (e.g., aggression, delinquency, and hyperactivity) and their alcohol consumption
He collects data from a sample of N = 165 adolescents. His directional hypothesis is that externalizing is more strongly related to alcohol use among adolescents who have an alcoholic parent
Externalizing behaviours is a continuously distributed variable (range from 0 to 2.50),
Alcohol use is a continuously distributed variable (range from 0 to 4.09),
Parental alcoholism is a categorical variable coded 0 if neither of the adolescent’s parents are alcoholics, and 1 if one or both of the parents are alcoholics. This variable is labelled CoA (child of alcoholic)
Parental alcoholism, externalizing behaviours, and alcohol use
We have learned that it’s easy to incorporate binary/dichotomous variables in regression; recall that a 1-unit increase on the dummy-coded variable describes the mean difference between the two groups
CoA (child of alcoholism) is a dichotomous/binary variable, which, in our example, serves as a moderator in a regression model explaining alcohol use based on externalizing behaviours
\[\hat{Alcohol}_i = \beta_0 + {\color{darkcyan}{\beta_1}}Externalizing_i + {\color{darkcyan}{\beta_2}}CoA_i+{\color{deeppink} {\beta_3}}(Externalizing_i \times CoA_i)\]
At the same time and equally valid, we can also say that…
Externalizing behaviour moderates the relation between CoA and alcohol use (two sides of the same coin). Mathematically, it’s exactly the same.
library(haven);library(e1071); library(kableExtra); library(tidyverse)
drink <- read_sav("drink.sav")
cols <- c("#F76D5E", "#72D8FF")
ggplot(drink, aes(x = as_factor(coa), y = alcuse, fill = as_factor(coa))) +
geom_boxplot( alpha = 0.85) +
geom_jitter(width = 0.15, color = "black", size = 1.5, alpha = 0.7) +
labs(x = "Child of Alcoholism", y = "Alcohol Use", fill = "Child of Alcoholism") +
theme_classic() + scale_fill_manual(values = cols)drink$CoA <- as_factor(drink$coa)
ggplot(drink, aes(x = ext, y = alcuse, color = CoA)) +
geom_smooth(method = "lm", se = TRUE, aes(fill = CoA), alpha = 0.25) +
geom_point(size = 1.5, alpha = 0.8) +
labs(x="Externalizing Behaviour", y = "Alcohol Use") +
theme(legend.position = "none") +
theme_classic()
Call:
lm(formula = alcuse ~ ext * CoA, data = drink)
Residuals:
Min 1Q Median 3Q Max
-1.2213 -0.2754 -0.1382 0.1372 3.4282
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.104718 0.106675 0.982 0.3277
ext 0.101535 0.173048 0.587 0.5582
CoACoA 0.004128 0.155173 0.027 0.9788
ext:CoACoA 0.564626 0.224237 2.518 0.0128 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6121 on 161 degrees of freedom
Multiple R-squared: 0.1937, Adjusted R-squared: 0.1787
F-statistic: 12.89 on 3 and 161 DF, p-value: 1.364e-07
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.104717893 0.1066750 0.98165395 0.32774320
ext 0.101535027 0.1730475 0.58674655 0.55819576
CoACoA 0.004128219 0.1551733 0.02660392 0.97880859
ext:CoACoA 0.564626007 0.2242367 2.51799144 0.01277935
Do the results indicate that the interaction between externalizing and CoA significantly explains additional variability in alcohol use over and above the individual effects?”
A) No, we need to conduct hierarchical regression to know that
B) Yes, the p value for the interaction term is significant, identical to the F test from a two model comparison differing only by this term
C) Yes, because interactions are always justified, regardless of statistical significance
D) Having a dog named “Shark” at the beach was a mistake
E) I’m not sure, can I call a friend?
Explaining Alcohol Use from Parental Alcoholism and Exeternalizing Behaviour
\[\scriptsize \begin{array}{lcccccc} \hline \text{Variable} & \hat{\beta} & SE(\hat{\beta}) & t & p & \text{95% CI} & sr^2 \\ \hline \text{(Intercept)} & 0.105 & 0.107 & 0.98 & .33 & [-0.11, 0.31] & \\ \text{Externalizing} & 0.102 & 0.173 & 0.59 & .56 & [-0.24, 0.44] & 0.08 \\ \text{CoA} & 0.004 & 0.155 & 0.03 & .98 & [-0.31, 0.31] & 0.05 \\ \text{Externalizing} \ \times \text{CoA} & 0.565 & 0.224 & 2.52 & .01 & [0.12, 1.01] & 0.03 \\ \hline R^2 = .194, \ F(3,161) = 12.94, \ p < .001 \end{array}\]
\[\scriptsize \hat{Alcohol}_i = \beta_0 + {\color{darkcyan}{\beta_1}}Externalizing_i + {\color{darkcyan}{\beta_2}}CoA_i+{\color{deeppink} {\beta_3}}(Externalizing_i \times CoA_i)\]
\[\scriptsize \hat{Alcohol}_i = 0.105 + {\color{darkcyan}{0.102}}Externalizing_i + {\color{darkcyan}{0.004}}CoA_i+{\color{deeppink} {0.565}}(Externalizing_i \times CoA_i)\]
Just like in a two-way ANOVA, our first and most interesting parameter is the one capturing the interaction term (\(\text{Externalizing} \ \times \text{CoA}\)), why?
Given that the research hypothesis pertained to an interaction between externalizing and being a child of an alcoholic parent in predicting alcohol use, our primary interest lies in the interaction effect
The parameter estimate for the interaction term, \(\hat{\beta}_3=0.567\) reflects the difference between the two slopes in Slide 22
That is, the difference in the two groups’ (CoA and non-CoA) strength of association between the focal predictor (externalizing) and outcome variable (alcohol use)
We can look at the results from the significance test to further infer if this difference in slopes is unlikely to be zero (i.e., whether the interaction is statistically significant)
These results suggests that there is some evidence that CoA moderates the relationship between externalizing behaviour and alcohol use
But how, or in what way, does parent alcoholism affect the relationship between externalizing and alcohol use? Given that there is an interaction term in the model, how should we interpret the parameter estimates?
We answer these questions by probing the interaction!
\[\hat{y}_i = \beta_0 + {\color{darkcyan} {\beta_1}}X_i + {\color{darkcyan} {\beta_2}}Z_i + {\color{deeppink} {\beta_3}}(X_i \times Z_i)\]
\[\hat{y}_i = \left( \beta_0 + {\color{darkcyan} {\beta_2}}Z_i \right) + ({\color{darkcyan} {\beta_1}} + {\color{deeppink} {\beta_3}}Z_i)X_i\]
The component in the first parentheses \(\left( \beta_0 + {\color{darkcyan} {\beta_2}}Z_i \right)\) produces the simple intercept for \(X\) and the second component in parentheses, \(({\color{darkcyan} {\beta_1}} + {\color{deeppink} {\beta_3}}Z_i)\), produces the simple slope coefficient for \(X\)
Why are we complicating things with math?!
Because we want to examine the relationship between \(X\) and \(Y\) at each level of the moderator
\[{\color{darkorange} {\omega_0}}=\left( \beta_0 + {\color{darkcyan} {\beta_2}}Z_i \right)\]
\[{\color{darkorange} {\omega_1}}=({\color{darkcyan} {\beta_1}} + {\color{deeppink} {\beta_3}}Z_i)\]
\[\scriptsize\hat{y}_i = \left( \beta_0 + {\color{darkcyan} {\beta_2}}Z_i \right) + ({\color{darkcyan} {\beta_1}} + {\color{deeppink} {\beta_3}}Z_i)X_i\]
\[\hat{y}_i = {\color{darkorange} {\omega_0}} + {\color{darkorange} {\omega_1}}X_i\]
\[\hat{y}_i = {\color{darkorange} {\omega_0}} + {\color{darkorange} {\omega_1}}X_i\]
From our new simple linear regression equation, we interpret \({\color{darkorange} {\omega_0}}\) and \({\color{darkorange} {\omega_1}}\) the same way that you would interpret an intercept and slope terms in a regression model…
For example, \({\color{darkorange} {\omega_0}}\), the simple intercept for \(X\), is the predicted value of \(Y\) when \(X_i = 0\),
And, \({\color{darkorange} {\omega_1}}\), the simple slope for \(X\), is the predicted change in \(Y\) associated with a one-unit change in \(X\), remember?
\[{\color{darkorange} {\omega_0}}=\left( \beta_0 + {\color{darkcyan} {\beta_2}}Z_i \right) \quad \quad \quad {\color{darkorange} {\omega_1}}=({\color{darkcyan} {\beta_1}} + {\color{deeppink} {\beta_3}}Z_i)\]
So the simple intercept and slope for \(X\) change when \(Z\) takes on different values
And, if you recall, \(Z\) is the categorical moderator variable which can take only certain kind of values (e.g., CoA and non-CoA, Male and Female, younger/middle/older adults)
That is, for a categorical moderator with \(K\) levels, we will need \(K\) simple regression equations to capture the relationships between \(X\) and \(Y\) at all \(K\) levels of the moderator!
Mathematically, it’s completely arbitrary as to which variable is referred to as the moderator
If \(X\) and \(Z\) interact to explain \(Y\), then we can say that \(X\) moderates the relation between \(Z\) and Y
OR, we can say that \(Z\) moderates the relation between \(X\) and \(Y\)—tomayto, tomahto
So, just as we can define the simple slope for \(X\) as a function of \(Z\), we can also define the simple slope for \(Z\) as a function of \(X\)
The original, substantive research question should be your guide as to which variable is the moderator and which simple slopes are interesting
In our current example, the conceptual moderator, CoA, is a binary variable
Thus, there are only two possible simple regression equations for the relation between externalizing and alcohol use, one for CoA (coa=1) and one for non-CoA (coa=0)
Let’s now calculate the two simple slope equations, recall that we re-organized our model to
\[\hat{y}_i = \left( \beta_0 + {\color{darkcyan} {\beta_2}}Z_i \right) + ({\color{darkcyan} {\beta_1}} + {\color{deeppink} {\beta_3}}Z_i)X_i\]
\[\hat{Alcohol}_i = \left( 0.105 + {\color{darkcyan} {0.004}}CoA_i \right) + ({\color{darkcyan} {0.102}} + {\color{deeppink} {0.565}}CoA_i)Externalizing_i\]
Stop! 🛑 Activity Time!
\[\hat{Alcohol}_i = {\color{darkorange} {\omega_0}} + {\color{darkorange} {\omega_1}}Externalizing_i= \\ \hat{Alcohol}_i = \left( 0.105 + {\color{darkcyan} {0.004}}CoA_i \right) + ({\color{darkcyan} {0.102}} + {\color{deeppink} {0.565}}CoA_i)Externalizing_i\]
That is, calculate the \({\color{darkorange} {\omega_0}}\) and \({\color{darkorange} {\omega_1}}\) for the two CoA categories
Look at the value of \({\color{darkorange} {\omega_1}}\) for the non-COA, where did you see it before?
What is the difference between the \({\color{darkorange} {\omega_1}}\) for CoA and that of non-CoA?
Where did you see this value before?
SIMPLE SLOPES ANALYSIS
When CoA = not CoA:
Est. S.E. 2.5% 97.5% t val. p
--------------------------- ------ ------ ------- ------- -------- ------
Slope of ext 0.10 0.17 -0.24 0.44 0.59 0.56
Conditional intercept 0.10 0.11 -0.11 0.32 0.98 0.33
When CoA = CoA:
Est. S.E. 2.5% 97.5% t val. p
--------------------------- ------ ------ ------- ------- -------- ------
Slope of ext 0.67 0.14 0.38 0.95 4.67 0.00
Conditional intercept 0.11 0.11 -0.11 0.33 0.97 0.34
CoA=0 is a small effect and not significantly different from zero (\(\hat{\beta}_{1_{non-CoA}} =0.10\), p=.56), indicating that the effect of externalizing behaviour on alcohol use is likely negligible (0.10 points out of a observed range of 4.09 points) among individuals who do not have an alcoholic parent
CoA=0 tells us the expected alcohol use for children of non-alcoholics with no externalizing behavior (i.e., ext=0; \(\hat{\beta}_{0_{non-CoA}}=0.10\)), but intercepts are usually not so helpful (unless we mean-centre our predictor/s…but more on this next week)CoA=1 has a larger effect which also happens to be statistically significant (\(\hat{\beta}_{1_{CoA}} =0.67\), p<.01), suggesting that the effect of externalizing behaviour on alcohol use is more prominent among individuals with at least one alcoholic parent
Instead, I recommend focusing on the coefficient for the interaction term and reporting the simple effects
Here’s a write up of the results from our research example:
Example Results Write-up
Externalizing behaviour, having parental alcoholism, and their interaction accounted for a substantial amount—about 20%—of the variability in alcohol use among adolescents, \(R^2=.19\), 95% CI [.09, .30], F(3, 161) = 12.94, p < .001.
The relationship between externalizing behaviour and alcohol use was significantly moderated by parental alcoholism, \(\hat{\beta}_3 = 0.56\), 95% CI [.12, 1.01], t(161) = 2.52, p = .013, suggesting that the simple slope of adolescents with at least one alcoholic parent was steeper than those with no alcoholic parents by about 0.56-points on alcohol use per one-unit on externalizing.
Tests of simple slopes indicated that for those with non-alcoholic parents, the effect of externalizing behaviour on alcohol use was small and not statistically significant \(\hat{\beta}_{1_{non-CoA}} =0.10\), 95% CI [-.24, .44], t(161) = 0.59, p = .56. Given an observed range of alcohol use (4.09 points), a 0.10 points—roughly 2.5%—is likely negligible. However, among adolescents with an alcoholic parent, the effect of externalizing behaviour on alcohol use was larger and statistically significant, \(\hat{\beta}_{1_{CoA}} =0.67\), 95% CI [.38, .95], t(161) = 4.69, p<.01; that is, among persons with alcoholic parent/s, we expect a 0.67-point increase on alcohol use for every one-unit difference on externalizing behaviour. This effect, although rather small (about 16.5% of the observed scale range), is still likely to be meaningful in real-world contexts. See Figure X for a plot of the interaction.
Moderation Assumptions
The assumptions of OLS regression apply equivalently to models with an interaction term and the same diagnostic procedures presented in earlier modules can be used
Recall, LINE:
And, of course:
In addition to the methods previously discussed for examining linearity, I’d also recommend looking at the relationship between the focal predictor and outcome at each level of the moderator
Luckily, the plots in the interactions package provide an easy way to get this by simply adding the argument linearity.check=TRUE, have a look:
Module 7 (Part 1)