I want to evaluate the effect of number of flowers (fixed effect) and soil nutritional content (fixed effect) on size of flower. The experimental design consists in 16 plants growing on two substrates (8 plants per substrate). I have more than one observation per plant for the size and number of flower and a unique observation of the soil nutritional content per plant. So, as the type of substrate influences the nutritional content and in some cases, I have more than one observation per plant, I put in the model substrate and plant nested in substrate as random effects.
However, when I tried to fit this model in R using the lme4
package, I received this error:
Error: number of levels of each grouping factor must be < number of observations
I believe this means that the random effects are not identified, but I have repeated measurements, so what could be wrong here ?