Download presentation
Presentation is loading. Please wait.
Published byLester Simon Modified over 6 years ago
1
Unit 15: Inferences about Two Quantitative Predictors and their Interaction
2
Learning Objectives For two quantitative IVs, you will learn:
How to quantify, test, and interpret “main” effects (effect of IV at mean of other IV) How to quantify, test and interpret an interaction How to quantify, test, and interpret “simple” effects of each IV at levels of other IV How to graphically display effects How to describe the effects in text How to interpret coefficients in centered models How to interpret coefficients in raw models How to link coefficients from centered and raw models to graphic representations of effects 2 2
3
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 among sexually active female adolescents (0-30). varDescribe(d) var n mean sd median min max skew kurtosis Att PP BC
4
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 (e.g., b1, R2) based on the correlations below? cor(d) 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)
5
Interactive Models: Two Quantitative Variables
mAtt = lm(BC ~ Att, data=d) modelSummary(mAtt) Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) * Att <2e-16 *** --- Sum of squared errors (SSE): , Error df: 123 R-squared: mPP = lm(BC ~ PP, data=d) modelSummary(mPP) Estimate SE t-statistic Pr(>|t|) (Intercept) < 2e-16 *** PP *** Sum of squared errors (SSE): , Error df: 123 R-squared:
6
Interactive Models: Two Quantitative Variables
Based on the correlations, what can you tell me about the additive 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 one predictor models b/c Att and PP are fully orthogonal (uncorrelated). 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. The SEs will be smaller in two predictor model b/c the model has less error What were possible outcomes if ATT and PP were correlated?
7
Interactive Models: Two Quantitative Variables
m2 = lm(BC ~ Att + PP, data=d) summary(mAdd) Coefficients Estimate SE t-statistic 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.
8
Interactive Models: Two Quantitative Variables
Coefficients Estimate SE t-statistic 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.
9
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.
10
Interactive Models: Two Quantitative Variables
Interaction terms are calculated as the product of the regressors for the IVs in the interaction. In this case, we simply multiple Att X PP You will typically want to CENTER the regressors in the primary model to yield tests of “main effects” of each IV as well as tests of the interaction. (More on this later) 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. We are manually coding interaction for now to reinforce your understanding You should NOT interpret coefficients from a model that includes AxB but does not include lower order effects (e.g., A, and B).
11
Interactive Models: Two Quantitative Variables
What will change in the two predictor “additive” 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.
12
Interactive Models: Two Quantitative Variables
mAdd = lm(BC ~ Att + PP, data=d) Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) <2e-16 *** Att <2e-16 *** PP <2e-16 *** --- Sum of squared errors (SSE): 750.0, Error df: 122 R-squared: mcAdd = lm(BC ~ cAtt + cPP, data=d) Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) <2e-16 *** cAtt <2e-16 *** cPP <2e-16 *** --- Sum of squared errors (SSE): 750.0, Error df: 122 R-squared:
13
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 additive 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.
14
Interactive Models: Two Quantitative Variables
>mcInt = lm(BC ~ cAtt*cPP, data=d) Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) <2e-16 *** cAtt <2e-16 *** cPP <2e-16 *** cAtt:cPP <2e-16 *** --- Signif. codes: 0 ‘***’ ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Sum of squared errors (SSE): 250.0, Error df: 121 R-squared: mcAdd = lm(BC ~ cAtt + cPP, data=d) Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) <2e-16 *** cAtt <2e-16 *** cPP <2e-16 *** --- Sum of squared errors (SSE): 750.0, Error df: 122 R-squared:
15
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP BC = *cATT *cPP *cAttXcPP Link intercepts and coefficients from each model their respective figures. NOTE: figures use raw (not centered) predictors. Means for both predictors are 3.
16
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP *cAttXcPP What would the interactive model look like if we hadn’t centered each IV? (bs, SEs. R2) R2 will remain the same. The b, SE, and test of the interaction effect remains the same Generally, all other bs and SEs will change as they will test different questions. These now test the simple effect of each IV when the other IV = 0 on the original raw scale of the variable. Doesn’t make sense to test in this example.
17
>mcInt = lm(BC ~ cAtt*cPP, data=d)
Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) <2e-16 *** cAtt <2e-16 *** cPP <2e-16 *** cAtt:cPP <2e-16 *** --- Sum of squared errors (SSE): 250.0, Error df: 121 R-squared: mInt = lm(BC ~ Att*PP, data=dBC) Coefficients Estimate SE t-statistic Pr(>|t|) (Intercept) Att < 2e-16 *** PP *** Att:PP < 2e-16 *** --- Sum of squared errors (SSE): 250.0, Error df: 121 R-squared:
18
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP *cAttXcPP BC = *ATT *PP *AttXPP Link intercept and coefficients from the raw model to the expanded figure below on right
19
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.
20
Interactive Models: Two Quantitative Variables
BC = *cATT *cPP *cAttXcPP BC = *ATT *PP *AttXPP 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
21
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
22
Interactive Models: Two Quantitative Variables
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. (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)?
23
Interactive Models: Two Quantitative Variables
BC = *Att *PP *AttXPP Effect of Att = *PP Effect of Att = * (1) = 5 dBC$cPP1 = dBC$PP -1 mcPP1 = lm(BC ~ Att*cPP1, data=dBC) summary(mcPP1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e e e Att e e < 2e-16 cPP e e e-06 Att:cPP e e < 2e-16
24
Interactive Models: Two Quantitative Variables
BC = *Att *PP *AttXPP Effect of Att = *PP Effect of Att = * (5) = 1 dBC$cPP5 = dBC$PP -5 mcPP5 = lm(BC ~ Att*cPP5, data=dBC) summary(mcPP5) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e-12 Att e-09 cPP e-06 Att:cPP < 2e-16
25
Interactive Models: Two Quantitative Variables
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…….
26
Text for Results Section
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= F(3,121) = , p < The effect of ATT was significant, b= 3.0, 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, b= -1.0, 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, b= 1.0, t(121) = The simple effect of ATT for participants who were experiencing low negative peer pressure (PP=1) was also significant, b=5.0, t(121)= 31.75, p < WHAT IS MISSING?
27
Publication Quality Figure
Figure Caption General Linear Model predicted values for Birth Control Use are displayed as a function of Attitudes about Birth Control at two levels of Peer Pressure (Low Peer Pressure = 2; High Peer Pressure = 4). Confidence bands for predicted values based on 1 SE are displayed in gray).
28
Two Quantitative Variables: Summary
For two quantitative IVs, you learned how to: How to quantify, test, and interpret “main” effects (effect of IV at mean of other IV) How to quantify, test and interpret an interaction How to quantify, test, and interpret “simple” effects of each IV at levels of other IV How to graphically display effects How to describe the effects in text How to interpret coefficients in centered models How to interpret coefficients in raw models How to link coefficients from centered and raw models to graphic representations of effects 28 28
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.