Download presentation
Presentation is loading. Please wait.
1
Unit 10: Inferences about Two Continuous Predictors and their Interaction
2
Interactive Models: Two Quantitative Variables
Example Effect of positive attitudes (1-5) about birth control and peer pressure to not use birth control (1-5) on intention to use birth control (0-30) among sexually active female adolescents. > varDescribe(d) vars n mean sd median min max skew kurtosis Att PP BC
3
Interactive Models: Two Quantitative Variables
If you regressed BC on Att and PP in two separate linear models, what can you tell me about these two models based on the correlations below? cor(dBC) Att PP BC Att PP BC Regression coefficient for Att will be positive. Regression coefficient for PP will be negative. R2 will be bigger for Att model (R2 = .56) than for PP model (R2 = .25)
4
Interactive Models: Two Quantitative Variables
> mAtt = lm(BC ~ Att, data=d) > modelSummary(mAtt) Coefficients: Estimate SE t Pr(>|t|) (Intercept) * Att <2e-16 *** --- Signif. codes: 0 ‘***’ ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Sum of squared errors (SSE): , Error df: 123 R-squared: > mPP = lm(BC ~ PP, data=d) > modelSummary(mPP) Estimate SE t Pr(>|t|) (Intercept) < 2e-16 *** PP e-09 *** Sum of squared errors (SSE): , Error df: 123 R-squared:
5
Interactive Models: Two Quantitative Variables
Based on the correlations, what can you tell me about the model including both Att and PP as regressors? cor(dBC) Att PP BC Att PP BC The regression coefficients will for Att and PP will match the coefficients from their respective bivariate models b/c Att and PP are fully orthogonal (uncorrelated). PP and Att each predict fully unique variance in BC. The R2 for the additive model will be equal to the sum of the R2’s from the two bivariate models, again b/c Att and PP are orthogonal.
6
Interactive Models: Two Quantitative Variables
What about partial eta2 for Att (or PP) in the 1 predictor model vs. the 2 predictor model? {specify the augmented and compact models to test Att for 1 and 2 predictor approaches. Specify the formula for partial eta2 Test for Att in: 1 predictor model 2 predictor model A: BC = b0 + b1*Att A: BC = b0 + b1*Att + b2*PP C: BC = b *Att C: BC = b *Att + b2*PP PRE = SSE(C) – SSE(A) SSE(C) Numerator is same for the both 1 and 2 predictor tests of Att Denominator is smaller for 2 predictor test Therefore, PRE for Att is bigger in 2 predictor model. Att produces a bigger proportional reduction in error
7
Interactive Models: Two Quantitative Variables
What about delta R2 for Att (or PP) in the 1 predictor model vs. the 2 predictor model? {specify the augmented and compact models to test Att for 1 and 2 predictor approaches. Specify the formula for delta R2 Test for Att in: 1 predictor model 2 predictor model A: BC = b0 + b1*Att A: BC = b0 + b1*Att + b2*PP C: BC = b *Att C: BC = b *Att + b2*PP Delta R2 = SSE(C) – SSE(A) SSE(mean only) Numerator is same for the both 1 and 2 predictor tests of Att Denominator is same for both 1 and 2 predictor tests Delta R2 for Att does not change. Att explains the same proportion of TOTAL variance (error) in both models
8
Interactive Models: Two Quantitative Variables
mAdd = lm(BC ~ Att + PP, data=dBC) modelSummary(mAdd) Coefficients: Estimate SE t Pr(>|t|) (Intercept) <2e-16 *** Att <2e-16 *** PP <2e-16 *** --- Sum of squared errors (SSE): 750.0, Error df: 122 R-squared: BC = *Att *PP What has this model required (or what havent we tested for)? It requires that the effect of each IV on the DV is constant across all levels/scores of the other IV. We have not tested for an interaction
9
Interactive Models: Two Quantitative Variables
Coefficients: Estimate SE t Pr(>|t|) (Intercept) <2e-16 *** Att <2e-16 *** PP <2e-16 *** --- Sum of squared errors (SSE): 750.0, Error df: 122 R-squared: BC = *Att *PP bAtt, bPP, b0, in figure? bAtt = slope of lines. Constant for all three lines. bPP = separation of lines. Lines are separated by 2 * bPP Constant across Att. b0, = predicted value at Att = 0 and PP= 0. Not displayed in figure.
10
Interactive Models: Two Quantitative Variables
How might we benefit from including a third regressor in the model to represent the interaction between Att and PP? Hint, there are two benefits If Att X PP effect is significant, it will increase R2, decrease SEs, and therefore increase power to test all effects. If Att X PP is significant, it will provide us with a more complex, nuanced perspective on the nature of the Att and PP effects on BC. Definition: An interaction exists when the effect of 1 predictor on the DV differs across levels/values of the other predictor. LINK to additive results in this example….
11
Interactive Models: Two Quantitative Variables
Regressors for interaction terms are calculated as the product of the regressors (for the predictors) in the interaction. In this case, we simply multiple Att X PP You will typically want to CENTER the IVs in the primary model to yield tests of “main effects” of each IV as well as tests of the interaction. More on this as the slides develop. In R, you don’t need to actually compute the product term regressor directly. A:B in the lm formula will include the AxB interaction regressor(s). A*B is further shorthand to include A, B, and AxB in the model. You should NOT include AxB in a model that does not include lower order effects (e.g., A, and B).
12
Interactive Models: Two Quantitative Variables
What will change in the two predictor model if we center both IVs? b0 and its SE will change. b0 is the predicted value at 0 on all regressors in the model. Will SE be bigger or smaller in centered model? bAtt and bPP (and their SEs) will remain the same. The additive model forces the effect for each IV to be same across all values of other regressors. Therefore, the effect of ATT is the same if PP = 0 or PP= 1, or PP=3, etc. Given this, centering PP does not change b for ATT Of course, R2 also remains the same.
13
Interactive Models: Two Quantitative Variables
mAdd = lm(BC ~ Att + PP, data=dBC) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) <2e-16 Att <2e-16 PP <2e-16 Sum of squared errors (SSE): 750.0, Error df: 122 R-squared: d$Attc = d$Att - mean(d$Att) d$PPc = d$PP - mean(d$PP) mAddC = lm(BC ~ AttC + PPC, data=dBC) Coefficients: Estimate SE t Pr(>|t|) (Intercept) <2e-16 *** AttC <2e-16 *** PPC <2e-16 *** --- Sum of squared errors (SSE): 750.0, Error df: 122 R-squared:
14
Interactive Models: Two Quantitative Variables
What will change when we add the interaction term (with centered IVs) relative to the centered two predictor model? An additional regressor will be included for Att x PP If Att x PP accounts for DV variance, R2 will increase and SEs for coefficients (and intercept) will be reduced. b0, will remain the predicted value at 0 for all regressors. No change from centered two predictor model bAtt and bPP are respective effects at 0 on all other regressors.. Including an interaction now allows for each IV effect to vary across levels/values of other IVs. Thus, bAtt is now the (“simple”) effect of Att at cPP = 0 and the bPP is now the (“simple”) effect of PP at cAtt = 0.
15
Main Effects and Simple Effects
In ANOVA terms, The MAIN EFFECT of an IV is the overall effect of that IV on the DV averaging across the levels of the other IV(s) in the model. A SIMPLE EFFECT of an IV is the effect of that IV at a specific level of the other IV(s) in the model. From this perspective, you can think about a main effect as a special simple effect where the specific level of the other IV is its average value.
16
Interactive Models: Two Quantitative Variables
> mIntC = lm(BC ~ AttC * PPC, data=d) > modelSummary(mIntC) Coefficients: Estimate SE t Pr(>|t|) (Intercept) <2e-16 *** AttC <2e-16 *** PPC <2e-16 *** AttC:PPC <2e-16 *** --- Sum of squared errors (SSE): 250.0, Error df: 121 R-squared: mAddC = lm(BC ~ AttC + PPC, data=dBC) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) <2e-16 cAtt <2e-16 cPP <2e-16 Sum of squared errors (SSE): 750.0, Error df: 122 R-squared:
17
Interactive Models: Two Quantitative Variables
BC = *AttC *PPC BC = *AttC+ -2.0*PPC *AttCXPPC Link intercepts and coefficients from each model their respective figures. NOTE: figures use raw (not centered) predictors. Means for both predictors are 3.
18
Interactive Models: Two Quantitative Variables
BC = *AttC *PPC *AttCXPPC What would the interactive model look like if we hadn’t centered each IV? mInt = lm(BC ~ Att*PP, data=dBC) summary(mInt) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) Att < 2e-16 PP e-06 Att:PP < 2e-16 Sum of squared errors (SSE): 250.0, Error df: 121 R-squared:
19
Interactive Models: Two Quantitative Variables
BC = *AttC *PPC *AttCXPPC BC = *Att *PP *AttXPP Link intercept and coefficients from the raw model to the expanded figure below on right
20
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP *cAttXcPP BC = *ATT *PP *AttXcPP So what does bAttXPP indicate? The coefficient for the interaction indicates how the simple effect of each IV changes for a one unit increase on the other IV.
21
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP *cAttXcPP BC = *ATT *PP *AttXcPP The interaction coefficient applies symmetrically to both IV effects Considering Att in raw model…. Att effect is 6 for PP = 0 Att effect is 5 for PP = 1 Att effect is 4 for PP = 2 Att effect is 3 for PP = 3 Att effect is 2 for PP = 4 Att effect is 1 for PP = 5
22
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP *cAttXcPP BC = *ATT *PP *AttXPP The interaction coefficient applies symmetrically to both IV effects Considering PP in raw model…. PP effect is 1 for Att = 0 PP effect is 0 for Att = 1 PP effect is -1 for Att = 2 PP effect is -2 for Att = 3 PP effect is -3 for Att = 4 PP effect is -4 for Att = 5
23
Interactive Models: Coefficient magnitudes
Interaction and its test is obtained from any model (regardless of centering) “Main” effects of IVs are obtained from model with all IVs centered on mean. You may or may not choose to report these main effects depending on the situation. Magnitude of ‘simple’ effects of either IV can be calculated directly from the raw or centered model (I prefer the raw model for ease of thinking in raw units). (HOW?)
24
Interactive Models: Raw model coefficients
> mInt = lm(BC ~ Att*PP, data=d) > modelSummary(mInt) Coefficients: Estimate SE t Pr(>|t|) (Intercept) Att < 2e-16 *** PP e-06 *** Att:PP < 2e-16 *** --- Sum of squared errors (SSE): 250.0, Error df: 121 R-squared:
25
Interactive Models: Simple effect magnitudes
Magnitude of ‘simple’ effects of either IV can be calculated directly from the raw or centered model (I prefer the raw model for ease of thinking in raw units. HOW? BC = *Att *PP *AttXPP Effect of Att = *PP Effect of PP = *Att How could you obtain formal significance tests for any specific simple effects (e.g., effect of Att at PP = 1, 3, & 5)?
26
Interactive Models: Simple effect magnitudes
BC = *Att *PP *AttXPP Effect of Att = *PP Effect of Att = * (1) = 5 dBC$PP1 = dBC$PP -1 mPP1 = lm(BC ~ Att*PP1, data=dBC) summary(mPP1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) Att < 2e-16 PP e-06 Att:PP < 2e-16
27
Interactive Models: Simple effect magnitudes
BC = *Att *PP *AttXPP Effect of Att = *PP Effect of Att = * (5) = 1 dBC$PP5 = dBC$PP -5 mPP5 = lm(BC ~ Att*PP5, data=dBC) summary(mPP5) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e-12 Att e-09 PP e-06 Att:PP < 2e-16
28
Interactive Models: Reporting Considerations
So what do you report and in what order? There is no one answer here. Some say you never report main effects when there are significant interactions. This camp would say, report only interaction and possibly simple effects Others (including me) believe that main effects are sometimes useful to report even when interaction is significant. ‘Main’ effects (effect at “mean” of other IV) provides an anchor for effect. The interaction then indicates how this effect changes across values of the other IV. ‘Simple’ effects can sometimes allow you to describe further how this effect changes at various values of other IV. The other complexity surrounds the nature of the two IVs. Sometimes, often, one is focal and one is moderator. However, sometimes neither/both are focal…….
29
Interactive Models: Sample Report
A sample brief report: Attitudes are focal, ‘main’ effect and simple effects reported. We analyzed birth control use in a General Linear Model with Positive Attitudes about Birth Control (ATT) and Negative Peer Pressure (PP) as quantitatively measured predictors. We also included the interaction between these two predictors in the model. We mean-centered all predictors. The overall model accounted for a significant amount of variance in Birth Control use, R2= 0.94, F(3,121) = , p < The effect of ATT was significant, 95% CI(b) = [2.8, 3.2], R2 = 0.56, t(121) = 33.00, p < .001, such that birth control use increased by 3 units for every one unit increase in positive attitudes about birth control for participants who experienced average peer pressure (i.e., PP=3). However, PP significantly moderated the ATT effect on Birth Control, 95% CI(b)= [-1.1, -0.9], R2 = 0.13, t(121) = 15.56, p < .001, indicating that the magnitude of the ATT effect decreased for every one unit increase in PP (see Figure 1). Despite this, the simple effects of ATT remained significant across meaningful levels of PP. For example, the simple effect of ATT for participants who were experiencing high negative peer pressure (i.e., PP = 5) was significant, 95% CI(b)= [0.7, 1.3], R2 = 0.02, t(121) = 6.35, p < The simple effect of ATT for participants who were experiencing low negative peer pressure (PP=1) was also significant, 95% CI(b)= [4.7, 5.3], R2 = 0.52, t(121)= 31.75, p < .001.
30
Interactive Models: Two Quantitative Variables
31
Two Quantitative Variables: Summary
For two quantitative IVs, you now know: How to quantify and test “main” effects (effect of IV at mean of other IV) How to quantify and test for interaction How to quantify and test “simple” effects of each IV at levels of other IV How to graphically display effects In case it wasn’t obvious, this is the conceptual equivalent of a factorial ANOVA with two quantitative rather than categorical) IVs 31 31
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.