Mixed Effects Model, Levels of grouping factor < observations

Searching previous threads has not provided me with an answer. I am modelling data from an experiment. The setup was as follows: Stimulus set of 110 images. 454 participants. Each participants rated 75 images (random from the pool of 110) and reported visual appeal.

Two measures of the images (visual clutter and colourfulness) are shown to have moderate to high correlation with visual appeal. I therefore want to include them in the model. I want to use both subjectID and stimulus (filename of stimulus) as a random effect. In R, using lme4, I enter:

ae.model = lmer(ae_rating ~ clutter_se + colourfulness + (1|subjectID) + (1|stimulus), data=lmm.data)

and get "Error: number of levels of each grouping factor must be < number of observations:". There is probably something I am not completely understanding about using mixed effects models. Does the above code somehow nest the random effects? Then I would understand the error (as subjects*stimuli > observations).

• If you do not get a response here I would suggest the R mailing list dedicated to mixed models. – mdewey Aug 16 '17 at 13:55
• Does the above code somehow nest the random effects? - No. The error message is strange. Double-check that lmm.data contains all the data. Can you post summary(lmm.data) or something similar that shows the number of rows and the number of levels of stimulus and subjectID? – amoeba Aug 16 '17 at 14:16
• The problem is solved. Summarizing identified that there were 111 levels of stimulus, somewhere in the data processing "test1" was in some places changed to "1". Model works now! Thanks. – Jelte van Boheemen Aug 18 '17 at 9:57