mardi 24 mai 2016

I cannot understand mistake lmer

I tried to solve the problem reading other answers but did not get the solution. I am performing a lmer model:

MODHET <- lmer(PERC ~ SITE + TREAT + HET + TREAT*HET + (1|PINE), data = PRESU).

Perc is the percentage of predation. Site is a categorical variable that I am using as blocking factor. It is site identity where I performed the experiement. TREAT is categorical variable of 2 levels. HET is a continuous variable. The number of observation is 56 divided in 7 sites Maybe the problem is how I expressed the random factor. In every site I selected 8 pines among 15 to perform the experiment. I included the pine identity as categorical random factor. For instance in Site 1 pines are called a1,a3,a7 ecc, while in site 2 are called b1,b4,b12 ecc... The output of the model is

Error: number of levels of each grouping factor must be < number of observations

I don´t understand where is the mistake. Could it be how I called the pines? I tried also

MODHET <- lmer(PERC ~ SITE + TREAT + HET + TREAT*HET + (1|SITE:PINE), data = PRESU)

but the output is the same. I hope that I explained well my problems. I read on this forum similar questions about it but I still do not get the solution.

Thank you for your help




Aucun commentaire:

Enregistrer un commentaire