[R-sig-eco] Problem with glmm with nested random effects

Juan juancho._2 at hotmail.com
Tue Oct 27 19:01:38 CET 2015


Hi
everyone. I am trying to run a glmm using the glmer function of the lme4
package but I keep getting this error:


“Error: couldn't evaluate grouping factor G:(mydata:`$`)
within model frame: try adding grouping factor to data frame explicitly if
possible

In addition: Warning message:

In mydata:`$` :

numericalexpression has 16 elements:
only the first used”

 

The model is:

“glmer(cbind(mydata$A,round(mydata$B)) ~ mydata$C + mydata$D
+ mydata$E + (1 |mydata$F/G), data=mydata, family=binomial)”


As you can see the problem apparently is caused by the
random effect term, which has a nested structure, as the model ran smoothly without
random effects. I’ve also tried including the random factors separately and it
worked ok.


How should I proceed in order to solve this error?


The data used (mydata) is a data frame composed of 361
rows and several columns with the following data:

- A - numeric (number of successes)

- B - numeric (number of failures)

-
C - integer

-
D - factor

-
E - numeric

- F - factor(alphanumeric values)

- G - factor(numeric values)



  		 	   		  
	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list