79654702

Date: 2025-06-05 14:51:54
Score: 2
Natty:
Report link

Thank you very much for your helpful responses and sorry for the delay in response, I unfortunately was unable to work on this project for a while.

Following your advice, I have now removed 'contrasts' from the data inputted into the GLMM and draw no inference from the model output. But, from the model I use the emmeans package to run comparisons and contrast and draw inference from there. I believe these are correct and align with the vignettes from emmeans.

###Main effects (con1 , con2, con1 X con2)
#con1: 3 levels = self, friend, stranger
#con2: 2 levels = happy, neutral

joint_tests(model)

#con1 - sig
#con2 - non-sig
#int  - sig

#----------------------#
###Unpicking 'main effect' of condition 1 (aggregated across condition2)
condition1_emm <- emmeans(model, pairwise ~ con1)
condition1_emm 

#----------------------#
###Unpicking 'interaction effect'
#condition 1 split by condition2 
#(Happy: self vs friend, self vs stranger, friend vs stranger)
#(Neutral: self vs friend, self vs stranger, friend vs stranger)
con1_by_con2 <- emmeans(model, pairwise ~ con1| con2)
con1_by_con2 

con1_by_con2 %>%confint()

#----------------------#
###Unpicking 'interaction effect'
#condition 2 split by condition1 
#(Self: Happy vs Neutral)
#(Friend: Happy vs Neutral)
#(Stranger: Happy vs Neutral)
con2_by_con1 <- emmeans(model, pairwise ~ con2| con1)
con2_by_con1 

con2_by_con1 %>%confint()

One other area I want to explore within the interaction is whether the difference between two people (e.g., self vs. friend) changes depending on the prime (happy vs. neutral). So, I have created custom contrast coding for this, is this correct and also okay to draw inference from please?

# Get the estimated marginal means for the interaction
emm_interaction <- emmeans(model, ~ con1 * con2)

# Define all three interaction contrasts with 6 elements each
contrast_list <- list(
 "Self_vs_Friend_Happy_vs_Neutral" = c( 1, -1, 0, -1, 1, 0),
 "Self_vs_Stranger_Happy_vs_Neutral" = c( 1, 0, -1, -1, 0, 1),
 "Friend_vs_Stranger_Happy_vs_Neutral" = c( 0, 1, -1, 0, -1, 1)
)

# Run the contrasts with multiple comparisons adjustment
emm_interaction_cont <- contrast(emm_interaction, contrast_list, adjust = "sidak")
emm_interaction_cont

#Confidence intervals
emm_interaction_cont%>%
  confint()

Thank you very much for your help.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: nalee_psych