I’m trying to perform a linear mixed effects analyses using the lme4 package on R. I need your help because of a recurrent error… I have 17 profiles (that participants had to rate) as repeated measures (they’ve seen every profil1,2,3 but only one version of them everytime, either 1a or 1b or 1c as in a classic latin squares design). I’m doing a score difference between profil-a type and profil-b ratings as fixed continuous effects as long as fixed categorical effects “ovul”.
DF$X<-rowMeans(cbind(DF$profil_1a,DF$profil_2a,DF$profil_3a,DF$profil_4a,DF$profil_5a,DF$profil_6a,DF$profil_10a,DF$profil_11a,DF$profil_12a,DF$profil_13a,DF$profil_14a,DF$profil_15a,DF$profil_16a, DF$profil_1b,DF$profil_2b,DF$profil_3b,DF$profil_4b,DF$profil_5b,DF$profil_6b,DF$profil_10b,DF$profil_11b,DF$profil_12b,DF$profil_13b,DF$profil_14b,DF$profil_15b,DF$profil_16b, DF$profil_1c,DF$profil_2c,DF$profil_3c,DF$profil_4c,DF$profil_5c,DF$profil_6c,DF$profil_10c,DF$profil_11c,DF$profil_12c,DF$profil_13c,DF$profil_14c,DF$profil_15c,DF$profil_16c),na.rm=TRUE)
DF$likertfort<-rowMeans(cbind(DF$profil_1a,DF$profil_2a,DF$profil_3a,DF$profil_4a,DF$profil_5a,DF$profil_6a,DF$profil_10a,DF$profil_11a,DF$profil_12a,DF$profil_13a,DF$profil_14a,DF$profil_15a,DF$profil_16a),na.rm=TRUE)
DF$likertmoyen<-rowMeans(cbind(DF$profil_1b,DF$profil_2b,DF$profil_3b,DF$profil_4b,DF$profil_5b,DF$profil_6b,DF$profil_10b,DF$profil_11b,DF$profil_12b,DF$profil_13b,DF$profil_14b,DF$profil_15b,DF$profil_16b),na.rm=TRUE)
DF$Wdif1<-(DF$likertfort-DF$likertmoyen)
mean(DF$Wdif1, na.rm=TRUE)
DF$ovul<- -0.5 *(DF$ovul=="Oui") + 0.5 *(DF$ovul=="Non")
When I insert the scenario (DF$X) and the subject as random variables as in:
DF.model = lmer(DF$Wdif1 ~ DF$ovul +(1|subject) + (1|X), data=DF)
I got the error: Error: number of levels of each grouping factor must be < number of observations. I understand the model is overparametrized but is this fixable? Or my number of participants (n=38) is just too small to perform such a model? Btw, when I perform without the random parameter "subject" it works apparently. Thanks in advance for all your help, j