[R-sig-ME] [R-sig-eco] general lineal mixed model with unbalanced data

Ben Bolker bolker at ufl.edu
Sun Mar 21 17:35:17 CET 2010


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.




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