class: center, middle, inverse, title-slide .title[ # Skills Lab 09: Moderation ] .subtitle[ ##
Different Slopes for Different Folks
] .author[ ### Dr Danielle Evans ] .date[ ### 23 March 2022 ] --- <style type="text/css"> a { color: #f77b00; } </style> ## Overview **Continuous Moderators & Categorical Moderators** - Step 1: Centring - Step 2: Fit Model - Step 3: Interpretation + Johnson Neyman Interval + Simple Slopes Analysis + Interaction Plot --- class: no-scribble ## Moderation Recap - With moderation we're looking at **when** variables are related - We can investigate whether the effect of our predictor is the **same** for all people or whether it **differs** under different conditions depending on the value of another variable – **the moderator** - Differences could be the **presence** of an effect, the **size** of the effect, or the **direction** of the effect <br><br> <img src="data:image/png;base64,#./img/mod1.png" width="80%" style="display: block; margin: auto;" /> --- class: no-scribble ## Moderation Recap - A **moderator** is a variable that affects the relationship between two others - it **modifies** it - Can be used in **correlational** or **experimental** designs with continuous or categorical variables + But don't forget: correlation does not equal causation unless you have a causal design!! - We run a moderation in the same way as a linear model but with 3 predictors: <br> <img src="data:image/png;base64,#./img/mod2.png" width="70%" style="display: block; margin: auto;" /> --- class: no-scribble ## Moderation Recap - With our 3 predictors: we have two **main effects** (i.e., 'lower-order effects'), and one **interaction effect** (i.e., 'higher-order effects') or in our case the **moderation**! - When using a linear model with multiple predictors normally, each of the **effects** (__*b*s__) are interpreted when the other variables in the model are **0** - But the interaction term in our moderation analysis means that the *b*s for the main effects are usually uninterpretable unless we **centre** our predictors... --- class: no-scribble ## Step 1: Grand Mean Centring - For continuous variables, we **centre** them by transforming them into deviations around a fixed point - in **grand mean centring** this 'fixed point' is the **overall mean** of that variable - We can then interpret our effects at **average levels** of the other variable rather than at **0** - To center our predictor and moderator, the code is nice & easy! ```r data <- data %>% dplyr::mutate( predictor_cent = predictor - mean(predictor, na.rm = TRUE), moderator_cent = moderator - mean(moderator, na.rm = TRUE)) ``` <br><br><br> <div class="tu" style="font-size:90%"> <p><b>Top Tip!</b> We only need to centre our <b>predictor</b> & <b>moderator</b> - not the <b>outcome</b>! </p> </div> --- class: no-scribble ## Step 1: Grand Mean Centring - For continuous variables, we **centre** them by transforming them into deviations around a fixed point - in **grand mean centring** this 'fixed point' is the **overall mean** of that variable - We can then interpret our effects at **average levels** of the other variable rather than at **0** - To center our predictor and moderator, the code is nice & easy! ```r data <- data %>% dplyr::mutate( predictor_cent = predictor - mean(predictor, na.rm = TRUE), moderator_cent = moderator - mean(moderator, na.rm = TRUE)) ``` <br><br><br> <div class="pc" style="font-size:90%"> <p><b>Demo!</b> Grand Mean Centring! </p> </div> --- class: no-scribble ## Step 2: Fitting our Model - Once we've centred our predictor and moderator, we can fit our model! - The code for **fitting our model** should be familiar to us: ```r my_model <- lm(outcome ~ predictor*moderator, data = data) ``` <br> - We can then **summarise our model**, which should also be familiar to us... ```r summary(my_model) broom::tidy(my_model, conf.int = TRUE) broom::glance(my_model) ``` <br><br> -- <div class="pc" style="font-size:90%"> <p><b>Demo!</b> Fitting & summarising our model! </p> </div> --- class: no-scribble ## Moderations VS Interactions - You might have noticed that the **code** to do a moderation analysis, is the exact same as interactions from last term! 🤯 - That's because they're essentially the same thing, except: + **Interactions** are used mainly with two **categorical predictors** + **Moderations** are used with at least one **continuous predictor** - They also differ conceptually... - In **moderations** we're implying that one of the variables is the driver of the differences in effects - one of our variables is the **predictor**, and one of them is the **moderator** + With **interactions**, we don't make that conceptual distinction - they're both seen as **predictors** --- class: no-scribble ## Step 3: Interpretation - Now we've fit our model, we want to interpret the results!! - The **model summary** tells us whether we have significant **main effects** of our **predictor** and **moderator**, and also if we have an interaction effect (a **moderation**) - The **Johnson-Neyman interval** shows us a '**zone of significance**' - The **Simple Slopes** analysis compares the relationship between predictor and outcome, at **low**, **average**, and **high** values of the moderator - The **Interaction Plot** visualises the **Simple Slopes** analysis --- class: no-scribble ## Interpretation: Code For **Simple Slopes** & **Johnson-Neyman interval**: ```r interactions::sim_slopes(model_lm, pred = predictor, modx = moderator, jnplot = TRUE, confint = TRUE) ``` For the **Interaction Plot**: ```r interactions::interact_plot(model_lm, pred = predictor, modx = moderator, x.label = "Predictor Label", y.label = "Outcome Label", legend.main = "Moderator Label") ``` -- <div class="pc" style="font-size:90%"> <p><b>Demo!</b> Interpreting our model! </p> </div> --- class: no-scribble ## Categorical Moderators - The process and interpretation is essentially the same for **categorical moderators** - The only differences are that: + We can't **grand mean centre** the moderator (but we should with our **predictor**) + & we can't get a **Johnson Neyman Interval** -- <br><br><br><br><br><br><br> <div class="pc" style="font-size:90%"> <p><b>Demo!</b> Fitting, summarising & interpreting our second model! </p> </div> --- class: no-scribble ## Different Slopes for Different Folks - In our final model, we have **two Main Effects** but no **Moderation** effect suggesting that the slopes of attractiveness on dating potential are the same for funny and dull dates... - But what if we *did* have a **moderation**? What might that look like? Give it a go on the next slide!! <img src="data:image/png;base64,#./img/p.png" width="70%" style="display: block; margin: auto;" /> --- ## Different Slopes for Different Folks - We already have the line for the **funny** group, let's try drawing a line for the **dull** group if we *did* have a moderation! <br> <img src="data:image/png;base64,#./img/em.png" width="80%" style="display: block; margin: auto;" /> --- class: no-scribble ## *That's all - happy moderating!* <br> <br> <img src="data:image/png;base64,#./img/mod.gif" width="80%" style="display: block; margin: auto;" /> .center[ [Give session feedback here!](https://forms.gle/ZyXAB7kZzUUyct9n6) 😀 ]