emmeans to calculate simple effects for significant GLMM interaction

19 Views Asked by At

Using R, the following GLMM model converged with significant interactions between window conditions ("window" and "no window") for all sound conditions using treatment contrasts (i.e., "quiet" vs "standard", and "standard" vs "deviant").

I want to run the simple effects comparisons for each of the sound conditions. Is there any way to use emmeans to do this (i.e., compare window to no window for quiet, standard and deviant separately)?

depvar.glmer1 = glmer(
  depvar ~ window*trial_sound + (1+ window*trial_sound|pp) + (1 + window|item),
  control=glmerControl(optimizer="bobyqa",optCtrl=list(maxfun=20000)), 
  data = datafile, 
  family= Gamma(link = "identity")
)

Dummy data set extract:

df <- structure(list(
  window = c("window", "no window", "window", "no window", "window", "no window", "window", "no window", "window", "no window", "window", "no window"), 
  trial_sound = c("standard", "standard", "deviant", "deviant", " quiet", " quiet", "standard", "standard", "deviant", "deviant", " quiet", " quiet"),
depvar = c(25, 22, 33, 32, 43, 42, 25, 22, 33, 32, 43, 42),
pp = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2), 
item = c(1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6)),
  .Names = c("window", "trial_sound", "depvar", "pp", "item"),
  row.names = c(NA, -12L),
  class = "data.frame") 
0

There are 0 best solutions below