class: center, middle, inverse, title-slide .title[ # Dan’s Dating DilemmR: Pt 2 ] .subtitle[ ##
Different Slopes for Different Folks
] .author[ ### Dr Danielle Evans ] .date[ ### 18 April 2024 ] --- class: red, middle <style type="text/css"> a { color: #009af5; font-weight: bold; } a.glossary { font-weight: bold; color: #8e7df1; cursor: help; position: relative; } .remark-inline-code { font-size: var(--code-inline-font-size); color: #4266ff; padding: 2px; } strong { font-weight: bold; color: black; } .remark-slide-number { color: black; opacity: 1; font-size: 0.9rem; } .hljs-github .hljs-string, .hljs-github .hljs-doctag { color: #333; } .hljs-github .hljs-literal { color: #333; } .hiddenFrame{ height:1px; width:1px; opacity: 0; } .red.remark-slide-content { background-color: #000000; font-size: 1rem; padding: 0; width: 100%; height: 100%; } <!-- .remark-container { --> <!-- background: #000000; --> <!-- margin: 0; --> <!-- overflow: hidden; --> <!-- } --> </style> <img src="data:image/png;base64,#img/lb.jpg" width="75%" style="display: block; margin: auto;" /> --- ## 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 <a class='glossary' title='Moderation analysis is a statistical technique used to examine whether the relationship between two variables (the predictor and outcome variables) changes depending on the level of a third variable, known as the moderator'>moderation</a> we're looking at **when** variables are related - A **moderator** is a variable that affects the relationship between two others - it **modifies** it - We can investigate whether the effect of our predictor on our outcome is the **same** for all people or whether it **differs** under different conditions depending on the value of **the moderator** <br><br> <img src="data:image/png;base64,#./img/mod1.png" width="80%" style="display: block; margin: auto;" /> --- ## Moderation Recap - Differences could be the **presence** of an effect, the **size/strength** of the effect, or the **direction** of the effect .pull-left[ .center[ <a class='glossary' title='Using a categorical moderator as an example, this means a significant relationship between the predictor variable and the outcome variable is present for one group, but absent for the other group'>Presence</a> <img src="data:image/png;base64,#./img/pres.png" width="100%" style="display: block; margin: auto;" /> ] ] .pull-right[ .center[ <a class='glossary' title='Using a categorical moderator as an example, this means the relationship between the predictor variable and the outcome variable is stronger for one group, and weaker for the other group'>Size</a> <img src="data:image/png;base64,#./img/str.png" width="100%" style="display: block; margin: auto;" /> ] ] ??? significant moderation = different slopes for different folks --- ## Moderation Recap - Differences could be the **presence** of an effect, the **size/strength** of the effect, or the **direction** of the effect .pull-left[ .center[ <a class='glossary' title='Using a categorical moderator as an example, this means the relationship between the predictor variable and the outcome variable is positive for one group, and negative for the other group'>Direction</a> **(1)** <img src="data:image/png;base64,#./img/dir.png" width="100%" style="display: block; margin: auto;" /> ] ] .pull-right[ .center[ <a class='glossary' title='Using a categorical moderator as an example, this means the relationship between the predictor variable and the outcome variable is positive for one group, and negative for the other group'>Direction</a> **(2)** <img src="data:image/png;base64,#./img/dir_2.png" width="100%" style="display: block; margin: auto;" /> ] ] --- class: no-scribble ## Moderation Recap - Moderation can be used in <a class='glossary' title='a form of research in which you naturally observe the relationships between variables. Correlational studies are non-experimental, which means that the experimenter does not manipulate or interfere with any of the variables'>correlational</a> or <a class='glossary' title='a form of research in which at least one variable is systematically manipulated to see the effect on an outcome variable'>experimental</a> designs with continuous or categorical variables + But don't forget: correlation does not equal causation unless you have a causal design!! --- ## For Today: LovebombR - We're returning back to my series of dating experiments for today's moderation analyses, and focusing on the act of <a class='glossary' title='Lovebombing is a manipulative tactic often employed in romantic relationships, characterized by excessive displays of affection, attention, and flattery in the early stages. Individuals who engage in lovebombing may lavish their partner with constant praise, gifts, and intense declarations of affection, often to the point of overwhelming them. While lovebombing may initially seem flattering and romantic, it can be a red flag for manipulation and control. The intention behind lovebombing is often to quickly establish a deep emotional connection and gain control over the other person. Once the target becomes emotionally invested, the lovebomber may then use this leverage to manipulate or exploit them, potentially leading to unhealthy or abusive dynamics in the relationship.'>lovebombing</a> - <a class='glossary' title='Lovebombing is a manipulative tactic often employed in romantic relationships, characterized by excessive displays of affection, attention, and flattery in the early stages. Individuals who engage in lovebombing may lavish their partner with constant praise, gifts, and intense declarations of affection, often to the point of overwhelming them. While lovebombing may initially seem flattering and romantic, it can be a red flag for manipulation and control. The intention behind lovebombing is often to quickly establish a deep emotional connection and gain control over the other person. Once the target becomes emotionally invested, the lovebomber may then use this leverage to manipulate or exploit them, potentially leading to unhealthy or abusive dynamics in the relationship.'>Lovebombing</a> refers to the excessive display of affection, attention, and flattery in the early stages of dating, often as a manipulative tactic -- - & I fall for it every single time **[everybody say 'awww']** --- ## For Today: LovebombR - But it turns out, that our **self-esteem** potentially affects our dating interest in 'the perpetrator', after experiencing their lovebombing 😅 <p><img style="width: 40%; height: 40%; float: right; padding: 1px;" src="data:image/png;base64,#img/dir_2.png"/></p> - Hypothesis: if we have **higher self-esteem**, there will be a **negative relationship** between perpetrator acts of lovebombing and our dating interest in them + i.e., with high self-esteem, we find their lovebombing **unattractive** - & if we have **lower self-esteem**, there will be a **positive relationship** between perpetrator acts of lovebombing and our dating interest in them + i.e., with low self-esteem, we find their lovebombing **attractive** - Note: all variables were measured on **continuous scales** --- class: no-scribble ## Moderation Process - We run a moderation in the same way as a linear model but with 3 predictors - We have two **main effects** (i.e., '<a class='glossary' title='Lower-order effects typically refer to the main effects or direct effects of independent variables on a dependent variable in a statistical model. In other words, they are the effects of the independent variables on the dependent variable without considering any interactions or moderation effects.'>lower-order effects</a>'), and one **interaction effect** (i.e., '<a class='glossary' title='Higher-order effects refer to interactions or moderation effects in statistical models. Unlike lower-order effects, which represent the main effects of independent variables on a dependent variable, higher-order effects involve the combined influence of multiple variables, often through interaction terms or moderation.'>higher-order effects</a>') or in our case the **moderation**! - When using a linear model with multiple predictors normally, each of the individual **effects** (__*b*s__) are interpreted when other variables in the model are **0** - The interaction term in our moderation analysis means that the *b*s for the main effects are usually uninterpretable unless we **centre** our predictors... <br> <img src="data:image/png;base64,#./img/mod2.png" width="70%" style="display: block; margin: auto;" /> --- class: no-scribble ## Step 1: Grand Mean Centring - For **continuous** variables only, we <a class='glossary' title='Centering, in the context of statistics and data analysis, refers to the process of adjusting the values of a variable so that the new values have a specified property, usually a mean of zero. This adjustment involves subtracting a constant value from each observation in the variable, typically the mean of the original variable.'>centre</a> 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 individual 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 only, we <a class='glossary' title='Centering, in the context of statistics and data analysis, refers to the process of adjusting the values of a variable so that the new values have a specified property, usually a mean of zero. This adjustment involves subtracting a constant value from each observation in the variable, typically the mean of the original variable.'>centre</a> 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 individual 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 hopefully feel familiar to us: ```r my_model <- lm(outcome ~ predictor*moderator, data = data) ``` <br> - We can then **summarise our model**, which should also feel 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 <a class='glossary' title='Johnson-Neyman intervals identify the range of values for the moderating variable where the relationship between the predictor variable and the outcome variable changes from statistically significant to statistically nonsignificant, or vice versa.'>Johnson-Neyman interval</a> shows us a '**zone of significance**' - The <a class='glossary' title='Simple slopes analysis involves calculating separate regression slopes/linear models (simple slopes) for the predictor variable at different levels of the moderating variable. Typically, simple slopes are calculated at specific values or intervals of the moderating variable such as -1 SD (low), the mean, and +1 SD (high). After calculating the simple slopes, we can interpret how the relationship between the predictor and the outcome changes across different levels of the moderator. We can examine whether the slopes are significant and in which direction they are trending.'>Simple Slopes</a> analysis examines the relationship between predictor and outcome, at **low**, **average**, and **high** values of the moderator (if **continuous**) - 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> --- ## Interpretation: Plot - Our significant moderation means we're no longer interested in the main effects, and our simple slopes analysis shows us this result: <img src="data:image/png;base64,#img/lb_plot.png" width="75%" style="display: block; margin: auto;" /> -- - Well that wasn't what I was predicting!! But maybe having a secure or anxious <a class='glossary' title='Attachment style refers to the way individuals relate to others in close relationships, particularly romantic relationships, based on their early experiences with caregivers. Attachment styles are believed to influence the quality and stability of relationships throughout life, impacting how individuals communicate, express emotions, and navigate conflict in their relationships.'>attachment style</a> might be a moderator too... --- 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** + Our simple slopes isn't looking at **low**, **mean** and **high** values of our **moderator** anymore, and instead will use what **groups** exist in our **moderator** (in our case, **secure** vs **anxious** attachment) -- <br><br><br><br> <div class="pc" style="font-size:90%"> <p><b>Demo!</b> Fitting, summarising & interpreting our second model! </p> </div> --- ## Different Slopes for Different Folks - We have **two main effects** but no **moderation** suggesting the secure & anxious slopes are very similar! - We already have the slope for the **anxious** group, using our results let's try drawing the slope for the **secure** group! <img src="data:image/png;base64,#./img/em1.png" width="80%" style="display: block; margin: auto;" /> --- ## Summary* - With moderation we're looking at **when** variables are related + Our moderating variable **modifies** the relationship between our predictor and outcome - Differences could be the **presence** of an effect, the **size**/**strength** of the effect, or the **direction** of the effect - Statistically very similar to interactions, but differ conceptually - We need to **centre** any **continuous** predictors and moderators before analysis - We can follow up any significant moderations with a **simple slopes analysis** to explore the relationship between our predictor and outcome, at different levels/categories of our moderator - If you remember one thing from today: a **significant moderation** means we have <font color="#f60084"><b>different slopes for different folks!</b></font> <br><br> <p style="text-align:left; font-size:60%">*all results are fictional, date at your own risk!</p> --- class: no-scribble ## *That's all - happy moderating!* <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) 😀 ]