Before we talk about what is fixed and what is random, let's first establish all the factors in the experiment. You mentioned the 2x2x2 structure (I'll call the factors AxBxC for simplicity). Really its a 2x2x2x19 structure since your factors were crossed with subjects (which when doing MLM, it is best to just think of subjects as another factor in the experiment, so AxBxCxS). Nested within each level of those 4 crossed factors is 24 replications. So the design is best summed up as R/AxBxCxS. If everything is completely balanced you should have 3648 rows in your long-form data file. Also, I assume you randomized the order of presentation, so the R factor (or Order column) won't be used (if you counterbalanced, it becomes more important).
You are correct that the definition of a random effect does not have consensus. However, I prefer to think of it in terms of generalizability (here is a good summary of other definitions and problems with all of them). A factor is random if you randomly selected levels from a population, and you hope to generalize your results to that population. So outside of N=2 psychometric studies, subjects are always treated as random because you really don't care about levels you chose, you care about the population average and dispersion. If you do marketing research, you may randomly sample people and brands, because you think some finding should generalize to other people and to other products.
Since you only selected 2 levels of your three experimental factors, first, if treated as random, you'd have zero power. That is both because you have few levels of the factors (its akin to having a study with 2 participants), and because beyond 2 random factors (you'd have 4) you'd need 10's of thousands of data points. So from a practical standpoint, you should be treating A, B, and C as fixed. Second, from a theoretical standpoint, they probably aren't randomly sampled from a population you hope to generalize to, so they seem pretty fixed to me anyways.
So it looks like you nearly have a simple repeated measured anova, but you have replications. I use lme4
for all my mixed anovas, even if there is only 1 random factor and I could just use aov
or car::Anova
. Step 1 is to try fitting the maximal model: lmer(rt_in~load*comp*sal+(load*comp*sal|id),data=main_data)
It may not converge. You could try upping the maximum number of iterations by adding the following control parameter to the function call: , control=lmerControl(optCtrl=list(maxfun=50000)
. This ups it to 50,000 iterations from 10,000 (the default). If it still doesn't converge, you peal away some assumptions. The maximal model allows all the random effects to correlate (p.s. a random effect is a random factor and interactions between random factors and fixed factors). It should be easier to converge when you don't let them correlate: lmer(rt_in~load*comp*sal+(1|id)+(0+load|id)+(0+comp|id)+(0+sal|id)+(0+load:comp|id)+(0+load:sal|id)+(0+comp:sal|id)+(0+load:comp:sal|id),data=main_data)
. Normally, you can't estimate the random effect of the 4 way interaction (the last parentheses in the most recent model) when doing repeated measures ANOVA, but since you have replications you can try. If it's still not working, remove just that parentheses.
For some more reading, check out the answer to this question, which was written by the person who introduced me MLM. It's a similar 3 way repeated measures ANOVA, but doesn't have the replications.