Skip to content
Prev 470 / 20628 Next

error regarding levels in grouping factor

Dear R-mixed models list,
After running a mixed model with level 4 and 3 crossed with level 2,
and level 2 nested within level 1:

lmer(y~ 1 + (1|level1/level2)+(1|level3)+(1|level4),data)

I get the following error:

ERROR:
number of levels in grouping factor(s) ?level2

Would someone kindly give me some insight as to what may have caused
this error or how to remedy this problem?

Best regards,
Sharif