


Hi, 

Thanks Ben for your answer. 

I admit to have under-estimated lmer; it does handle
several random variables with poisson errors. The next model did not generate
any error message. 

model<-lmer(riqueza~dist+arbol100+cercas100+(1|esp.madre)+(1|rancho),family=poisson,data=env)


But when I add another discrete explaining variable: 

Model2<-lmer(riqueza~dist+arbol100+cercas100+dist.bosque+(1|esp.madre)+(1|rancho),family=poisson,data=env)


Error
in asMethod(object) : matrix is not symmetric [1,2]

In
addition: Warning messages:

1: In
mer_finalize(ans) :

  Cholmod warning 'not positive definite' at
file:../Cholesky/t_cholmod_rowfac.c, line 432

2: In
mer_finalize(ans) :

  Cholmod warning 'not positive definite' at
file:../Cholesky/t_cholmod_rowfac.c, line 432

3: In
mer_finalize(ans) : false convergence (8)

 

 

I suspect it could be related with the experimental
design being unbalanced? (the number represents the value of the extra variable
which the model does not except)

              ind    1   
2    3    4   
5    6    7   
8    9   10  
11   12   13  
14   15   16  
17   18

rancho
esp.madre                                                 
                                            

AC     Gua-ulm       1350 .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

       Pit-dul       .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    450  .   
.   

ADC   
Gua-ulm       .    .   
.    .    .   
135  90   45  
.    .    .   
.    .    .   
.    .    .   
.   

      
Pit-dul       .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    450 
.    .    63  
405 

HS    
Gua-ulm       .    .   
.    .    1350 .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   

      
Pit-dul       .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

JAG   
Gua-ulm       .    .   
.    900 
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .   

      
Pit-dul       .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

JC    
Gua-ulm       .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

      
Pit-dul       .    .   
.    .    .   
.    .    .   
1350 1350 450  .    720 
.    225  .   
.    .   

JUC   
Gua-ulm       .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

      
Pit-dul       .    .   
.    .    .   
.    .    .   
.    .    .    900  .   
.    .    .   
.    .   

MAS    Gua-ulm       .   
.    1350 .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

       Pit-dul       .  
 .    .   
.    .    .    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

PM     Gua-ulm       .   
2700 .    .    .   
.    .    .   
.    .    .   
.    .    .   
.    .    .   
.   

       Pit-dul       .   
.    .    .   
.    .    .   
.    .   
.    .    .   
.    .    .   
.    .    .

 

 

But why does the model does accept the other variables
with similar structure, such as below? 

              
ind   1   2  
3   4   5   6   7  
8   9  10 
11  12  13 
14  15  16 
17  18

rancho
esp.madre                                                                           


AC     Gua-ulm       63 
.   .   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.  

       Pit-dul       .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   63  .  
.  

ADC   
Gua-ulm       .   .  
.   .   .  
54  126 144 .   .  
.   .   .  
.   .   .  
.   .  

       Pit-dul       .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
126 .   .   90 
171

HS    
Gua-ulm       .   .  
.   .   72 
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.  

      
Pit-dul       .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.  

JAG   
Gua-ulm       .   .  
.   27  .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.  

      
Pit-dul       .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.  

JC    
Gua-ulm       .   .  
.   .   .  
.   .   .  
.   .   .   .  
.   .   .   .   .  
.  

      
Pit-dul       .   .  
.   .   .  
.   .   .  
270 144 117 .   99  .   216
.   .  
.  

JUC   
Gua-ulm       .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.  

      
Pit-dul       .   .  
.   .   .  
.   .   .  
.   .   .   99  .  
.   .   .  
.   .  

MAS    Gua-ulm       .  
.   9   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .  

       Pit-dul       .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .  

PM     Gua-ulm       .  
54  .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .  

       Pit-dul       .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .   .  
.   .  

 

The data set has 162 observations, alternative models with less parameters
generates the same error message. 

 

>model<-lmer(riqueza~dist.bosque+(1|esp.madre)+(1|rancho),family=poisson,data=env))

Error in asMethod(object) : matrix is not symmetric
[1,2]

In addition: Warning messages:

1: In mer_finalize(ans) :

  Cholmod
warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line
432

2: In mer_finalize(ans) :

  Cholmod
warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line
432

3: In mer_finalize(ans) : false convergence (8)

 

How should I analyse these unbalanced countdata?

 str(env)
'data.frame':   162 obs. of  12 variables:
 $ trampa     : Factor w/ 162 levels "ACGua-ulm111",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ rancho     : Factor w/ 8 levels "AC","ADC","HS",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ esp.madre  : Factor w/ 2 levels "Gua-ulm","Pit-dul": 1 1 1 1 1 1 1 1 1 2 ...
 $ ind        : Factor w/ 18 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 16 ...
 $ dist       : int  1 1 1 2 2 2 3 3 3 1 ...
 $ rep        : int  1 2 3 1 2 3 1 2 3 1 ...
 $ dist.bosque: int  150 150 150 150 150 150 150 150 150 50 ...
 $ arbol100   : int  7 7 7 7 7 7 7 7 7 7 ...
 $ cercas100  : int  4 4 4 4 4 4 4 4 4 1 ...
 $ site.totals: num  266.56 291 1334.37 1.16 2 ...
 $ riqueza    : int  9 21 19 3 3 8 5 4 3 22 ...
 $ dista      : int  1 1 1 2 2 2 3 3 3 1 ...





David Douterlungne, 

Phd student

ECOSUR, México

> Date: Sun, 21 Mar 2010 12:35:17 -0400
> From: bolker@ufl.edu
> To: daviddouter@hotmail.com
> CC: r-sig-mixed-models@r-project.org
> Subject: Re: [R-sig-eco] general lineal mixed model with unbalanced data
> 
> 
> David Douterlungne wrote:
> > 
> > 
> > Hi al, 
> > 
> > 
> > I am trying
> > to fit a general lineal mixed modal to a small unbalanced dataset of countdata
> > (poisson errors). My model would be: 
> > 
> > 
> > glmer(indep~dep1+dep2+dep3+dep4+dep5+(1|random1)+(1|random2),family=
> > 
> > poisson,data)
> > 
> >  
> > 
> > Error en
> > asMethod(object) : matrix is not symmetric [1,2]
> > 
> > Además: Mensajes de aviso perdidos
> > 
> > 1: In mer_finalize(ans) :
> > 
> >   Cholmod warning 'not positive definite' at
> > file:../Cholesky/t_cholmod_rowfac.c, line 432
> > 
> > 2: In
> > mer_finalize(ans) :
> > 
> >   Cholmod warning 'not positive definite' at
> > file:../Cholesky/t_cholmod_rowfac.c, line 432
> > 
> > 3: In
> > mer_finalize(ans) : false convergence (8)
> > 
> >  
> > 
> > That
> > isn´t a surprising R-answer, as lmer doesn´t work with several crossed (not
> > nested) random factors if errors are not Gaussian. 
> 
>    What makes you say this?  I posted an example in the last couple of
> days (search for "cloglog") that works.  Perhaps you are thinking of the
> fact that glmer doesn't work with adaptive Gauss-Hermite quadrature
> ('nAGQ'>1) with multiple random factors?
> 
> > I read about a mysterious" hacked version of glmer to allow
> > per-observation random effects" in Zuur et al, 2009?
> > 
> > Any one
> > knows if there is (already) a function that does the job? 
> > Are
> > there any best alternatives?
> 
>   Can you post a reproducible example?
> 
>   You say you have a 'small' data set -- I strongly suspect you are
> overfitting (you are trying to fit 5 fixed factors -- even if these are
> all continuous, or treatments with only two levels, you should have at
> least 50 data points to have a reasonable hope of fitting the model, and
> that's not counting random effects).
> 
>   If one of your random effects is per-observation you should get an
> error stating that you have >= as many as random-effect levels as
> observations, but you shouldn't get an obscure error (such as "matrix is
> not symmetric") as long as your model is well-defined, even if it's too
> much to fit from your data.  Doug Bates has hinted that he's thinking
> about relaxing the (observations > random-effect levels) restriction for
> glmer ... but you probably need to worry first about whether you can
> plausibly fit this model to your data set.
> 
>   The easiest thing to do at present for individual-level random effects
> is to use MCMCglmm instead -- it adds an individual-level random effect
> level by default.
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.

	[[alternative HTML version deleted]]


