factorial within-subjects model with some kind of grouping of answers

Hello!

I am looking for help with model formulae for data from my experiment. The experiment is fully crossed within-subjects repeated-measures design, and I intend to use a Generalized Linear Mixed Model analysis.
In my experiment I have two factors: first one has 8 levels, and the second one has 4 levels. However, the part that I can't figure how to model is that I was displaying each 8 levels of 1st factor next to each other, with a certain level of 2nd factor. In total, each participant was rating the 8 conditions 4 times - once per each level of 2nd factor.
My problem is that I can't figure out the proper formulae in R to describe this situation, that the conditions were grouped in a way, displayed simultaneously and that the comparison was between them. I know that for a regular factorial repeated measures I can have a model like this:

Y ~ X1*X2 + (1|S)

I presume in my case I should include random intercept and slope for X1 factors, to vary across levels of X2 factor? So, maybe this is the model I should run:

Y ~ X1*X2 + (1|S) + (X1|X2)

Thank you in advance for all the help!

This topic was automatically closed 21 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.