I need to write a model in R by using nlme library with multiple random intercepts and slopes.
What I need is:
- Random intercept for Participants,
- Random intercept for TargetID,
- Random slope to see how the effect of OrderofImages varies across participants,
- Random slope to see how the effect of OrderofImages varies across TargetID (meaning different targets)
MyModel
lme(Ratings ~ OrderofImages,
random = list(
1|Participants,
1|TargetID,
OrderofImages|Participants,
OrderofImages|TargetID),
data = myData,
na.action = na.exclude)
Many thanks for your help!