2

I want to use liner mixed effect model to analyse data from a within-subject experiment. In my experiment, each participant (PP, 30-level factor) watch 6 videos (Video), and each video contains 50 sentences (Sentence) and each sentence has 100 words (word).

If I code each random effect uniquely, which means that will be 6 levels for Video, 300 levels for Sentence (e.g., video 1_sentence1), and 3000 levels for word (e.g., video1_sentence1_word1). So in my crossed and nested random effect structure, it will look like: Lmer = dv~ ResponseTime+(1| PP)+(1|Video)+(1|Sentence)+(1|Word), is it correct?

But if I don't code them uniquely, which means that there will be 6 levels for Video, 50 levels for Sentence, and 100 levels for word. In this case, I should use the following structure: Lmer = dv~ ResponseTime+(1| PP)+(1|Video)+(1|Video:Sentence)+(1|Video:Sentence: Word). Right?

Chloe
  • 363

1 Answers1

1

I think you've got this !

This looks correct to me. The only thing I would add is that in the 2nd, model you can write this more compactly, and more expressively as:

dv ~ ResponseTime + (1|PP) + (1|Video/Sentence/Word)
Robert Long
  • 60,630
  • thanks @Robert Long! Just to ensure that I understood it accurately, is (1|Video)+(1|Video:Sentence)+(1|Video:Sentence: Word) handled in the same way as (1|Video/Sentence/Word) by lmer? In other words, in (1|Video/Sentence/Word), all three random effects (i.e., video, sentence, word) are handled by lmer? – Chloe Jun 05 '21 at 09:08
  • 1
    Yes, (1|A/B) is exactly the same as (1|A) + (1|A:B) and (1|A/B/C) is exactly the same as (1|A) + (1|A:B) + (1|A:B:C) - it's just a kind of shorthand. – Robert Long Jun 05 '21 at 09:16