I have a doubt about nesting random effects. I'm using R with the lme4 package and, in particular, the glmer function with binary family. I will describe the data first --

In this experiment, people answer sentences related to some verbs with a binary answer. They are given a prompt to formulate their answer, and this prompt is one of the variables. Each sentence appears with one different prompts (of two) to different participants in a randomised manner.

Two more binary variables are present and they're bound to the verb: verbs can be divided in two different ways: two classes, A and B, and two types, Y and X. But a verb cannot appear in both A and B forms depending on the context, so each item/verb in the experiment only appears in one of the two variants. That means that verb1 is always A and X, verb2 is always B and X and so on.

My doubt is how to define the random effect for verb/item, knowing that the data does not allow for each item to appear in both conditions of class and type. I thought nesting would solve it in this way:

Answer ~ Prompt + Class + Type + 
         (Prompt + Class + Type | participant) + 
         (Prompt | verb:class) + (Prompt | verb:type)

But I'm not totally sure if it makes sense. My questions are:

  1. Is it okay to include verb as a random effect nesting it twice (within class and withing type), as in the formula above?
  2. Is it possible that this definition of the random effects would "absorb" the fixed effects, reducing their estimates or significance?
  3. Does it make sense to include verb as a random effect at all, given that each verb can only appear in one class and one type?

Class and Type are fixed effects. They should not be grouping variables for random intercepts. participant and verb are crossed, so I would start with the model:

Answer ~ Prompt + Class + Type + (1 | participant) + (1 | verb)

and then consider adding random slopes, if supported by the underlying theory and the data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.