[R-sig-ME] lme4, error inserting nested structure of fixed factors in glmer

PALACIO BLASCO, SARA s.palacio at ipe.csic.es
Wed Feb 27 12:48:48 CET 2013

Dear List Members,

I do not know how to specify a nested structure of fixed factors in  
glmer. All the previous help messages I have found about nested  
factors in lme4 relate to “random” factors, but I need my “fixed”  
terms to be nested. I have a data set of 1386 observations with the  
following structure:
-	binary response variable: “Dead” = bud survival, either dead (1) or  
alive (0)
-	Fixed factor: “fTreatment”, numerical factor with 9 different levels
-	Fixed factor: “fBud_type”, categorical factor with 3 levels
-	Fixed factor “Species” (categorical) nested within “fBud_type”, with  
9 levels
-	Random factor “fRep”, numerical, nested within “Species”, with 24  
levels (i.e. coded sequentially to avoid confusion).

The model I want to run is:

M_bud_type1=glmer(Dead~fTreatment* fBud_type * fBud_type|Species +  
(1|fRep), family=binomial, data=species)

Note I do not know how to specify the nested nature of “Species”  
within “Bud_type” in glmer so I have used the notation that I would  
use for random models but it may not be valid.

Trying to run this model produces the following error:

Error in mer_finalize(ans) : Downdated X'X is not positive definite, 1.

I have read in previous help messages from R lists that this error is  
related to fixed-effects specification being rank deficient. I  
understand such rank deficiencies are due to singularities in the  
fixed effects matrix, i.e. the fact that since “species” is nested  
within “bud_type”, not all species show all bud_types. I presume that  
the way to solve this issue may be specifying the nested nature of  
“species” but none of the codes I try seem to work, i.e. I have  
unsuccessfully tried the following:

M_bud_type1=glmer(Dead~fTreatment* fBud_type * fBud_type:Species +  
(1|fRep), family=binomial, data=species)

M_bud_type1=glmer(Dead~fTreatment* fBud_type * fBud_type/Species +  
(1|fRep), family=binomial, data=species)

M_bud_type1=glmer(Dead~fTreatment* fBud_type * Species%in%fBud_type +  
(1|fRep), family=binomial, data=species)

I know the issue is with the combination of “fBud_type” and “Species”  
as fixed factors, since when I run the model with each of the two  
factors alone or with “Species” as a random factor it works fine.  
However, this does not solve my problems since I am interested in the  
significance of “Species” as a factor.

Any indications as to how to proceed will be deeply appreciated

Sara Palacio

More information about the R-sig-mixed-models mailing list