I have used a repeated-measures ANOVA in SPSS to analyse some of my data. It's the typical approach in my area, but I think it might be more appropriate to use a mixed effect model. However, I struggle with both building the model as well as interpreting it.
300+ participants from two different samples have rated on a continuous scale a stimulus at seven different manipulation levels. I want to test whether individual differences in the participants (recorded as ordinal or binary variables) interact with that rating score. In particular, I'm interested in whether the rating score changes as a function of stimulus level differently in people that, for example, feel mainly attracted to men or women.
Thus, I have a within-subjects factor (stimulus level), a between-subjects factor (such as being attracted to men or women), and a random effect of participant nested in sample.
I've been using
lmer() from the lme4 package and lmerTest and have come up with the following model
model <- lmer (rating.score ~ stim.level + factor + stim.level*factor + (1|participant) + (1|sample), mydata)
- Is lmer() the right package to work with?
- Am I appropriately accounting for the random effects of participant and sample, or do I need something like
(1|sample/participant)? I followed the Pastes data example, but am not sure that's the right thing to do in this context.
- Based on previous literature, I expect the relationship of
stim.levelto be quadratic - should/could I enter
stim.levelas squared term?
In SPSS, I find a significant interaction of
factor. By visualizing the interaction and running post-hoc tests I can then interpret the nature of that interaction. In R, I get estimates of the interaction at each level of
stim.level, some of which are significant, some of which are not. Can I still make the conclusion that
factor affects the relationship of
stim.level (even though not necessarily to the same extent at each level)?
EDIT: I just realized I had entered
stim.level as a factor. I think it is appropriate to enter it as a linear variable - the different levels correspond to the same manipulation applied with increasing extent (the steps between each level are the same). This also resolves one of my earlier questions regarding an error message when trying to model random slopes which I have thus now removed.