1

I am trying to work out how best to specify a random-effects structure for a mixed effects model. My experiment had 85 participants, who each completed 96 trials of a task. From observing the data, I can see clear differences across participants (presumably due to latent individual differences) AND differences that are seemingly related to trial number (I suspect because of a learning/boredom effect).

I would like to account for both of these factors as random effects in my model.

I originally specified my model as follows:

lmer(y~pred_1 + (pred_2*pred_3) + (1|PARTICIPANT) + (1|Trial_number), my_data)

However, after reading another post about how to specify nested effects here, I am slightly confused as to whether my effects are crossed (as above) or nested: Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?

My understanding of the above post is that since each participant in my experiment each experiences a 'trial 1', the models are crossed, rather than nested. As such the initial model feels correct. However, my understanding in this area is very limited, and i would really appreciate it if anyone had any insight.

Best wishes.

dipetkov
  • 9,805
  • Your model with random intercepts and random slopes needs to be studied to determine what induced intra-subject correlation pattern it provides. Is this pattern a realistic fit to the data or do you need a serial correlation model (generalized least squares or a Markov model)? – Frank Harrell Aug 10 '22 at 11:35

1 Answers1

1

if I understood your design correctly - that all your participants went through the same 96 trials - random effects are crossed in your data and your code is correct. In the output you will get separate estimates for participant-related variance and trial-related variance in y.

Edit. this may clarify the issue https://yury-zablotski.netlify.app/post/mixed-effects-models-2/

If you have observations or participants that are particular to a certain cluster (e.g. trials that only some participants went through, or participants are students from different schools), you have nested random effects. Otherwise crossed.

Sointu
  • 1,846