follow-up interaction resulted from lmer

I have two dependent variables: Gaze Duration and Total Time that are reading time (RT), and three independent variables: cCue (grammatical, semantic), cAttachment (low, high) and cGroup (HS, L2) that are dummy coded as (-0.5 and 0.5). I carried out maximal random effects structures, my model is:

w2.lme.full <- w2 %>%
  group_by(Reading_Measure) %>% 
  nest() %>% 
  mutate(fit = map(data, ~ lmer(RT ~ cCue*cAttachment*cGroup + (1|Participants) + (1|item), REML = FALSE, data = .x)))
str(w2.lme.full$fit[1:2], max.level = 1)

The results show interaction between cCue:cGroup. To follow up on this interaction I want to create a model with a single effect that contains the unique combinations from the interaction, let’s call it CueGroup. Then test only this effect:
RT ~ CueGroup + (1|Participants) + (1|Item)
glht(new model, linfct = mcp(cCuecGroup = "Thkey"))

However, I am having difficulty creating that single effect with interaction. Is there another way to do a post-hoc on interaction?

Welcome! Adding an example dataset to your question will help folks help you. It doesn't have to be your real data, just something similar that code can be run on. :grinning: See some ideas on how to do this here.

That being said, it sounds like this could be a job for the emmeans package, although I'm not sure how/if this will work with your dummy coding rather than having your factors as factors. The package has a pretty thorough set of vignettes listed here that you may find helpful for getting started.

If working with factors you don't need to refit the model, but instead ask emmeans() for the comparisons you are interested in (ideally driven by the research question and not just a specific small p-value :wink:). The function will average over the variables that aren't of interest.

If you are interested all pairwise comparisons of factors you would do something like

emmeans(fit, pairwise ~ cCue:cGroup)

If you were interested in comparisons among, e.g., cCue within each cGroup you'd do

emmeans(fit, pairwise ~ cCue|cGroup)
1 Like

Thank you for taking the time, your answer was helpful!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.