Here comes my case:
I conducted an experiment with the following design:
- 30 participants, each with a unique id, were screened and classified according to a trait.
- Then, all participants were tested in two conditions (in random order), and each outcome was measured for each limb of each participant (in random order as well).
$id : Factor w/ 30 levels $trait : Factor w/ 2 levels "Y", "N" $condition : Factor w/ 2 levels "CTL", "EXP" $limb : Factor w/ 2 levels "R", "L" $outcome : num
If we were to calculate whether the outcome differs between conditions or traits and their interaction, the left side and fixed terms of the
lmer formula would be something like
outcome ~ condition * trait.
And here comes when I need your expertise. So far, I believe that the random terms of my model should take into account that:
- Participants (id) in each trait are completely different (Q1 Is id really nested within trait?)
- Each trait/id has 4 related outcomes: 2 conditions (CTL, EXP) x 2 limbs (R, L). (Q2 Are trait/id, condition and limb crossed?)
m1 <- lmer(outcome ~ condition * trait + (1|id) + (1|limb) + (1|condition), data) m2 <- lmer(outcome ~ condition * trait + (1|outcome/id) + (trait|limb) + (trait|condition), data) m3 <- lmer(outcome ~ condition * trait + (1|condition/limb/id), data)
Note: m3 returns the following Error message:
number of levels of each grouping factor must be < number of observations.
[EDITED:] No matter how many models I try, I am never sure about what terms would be reasonable to include as randoms. My main question then (Q3) is: should I specify, incorporating random effects, that there exist nested and crossed variables?
Furthermore, I have a last question (Q4): Would it make sense to initially include limb as a fixed term, to explore possible differences between hemispheres, and in case of not finding any limb differences continue the analisis modelling it as random?
I would really appreciate if some of you could point me in the right direction...