[R] lmer with spatial and temporal random factors, not nested

Ben Bolker bbolker at gmail.com
Tue Feb 7 18:04:37 CET 2012


Marte Lilleeng <mlilleeng <at> gmail.com> writes:

> 
> Hi, I am new to this list.

  The r-sig-mixed-models at r-project.org mailing list would
be more appropriate for this question -- please direct any
further questions there ...

> I have a question regarding including both spatial and temporal random
> factors in lmer. These two are not nested, and an example of model I
> try to fit is
> 
> model1<-lmer(Richness~Y+Canopy+Veg_cm+Treatment+(1|Site/Block/Plot)+
> (1|Year),
> family=poisson, REML=FALSE),
> where
> richness = integer
> Y & Treatment = factor
> Canopy & Veg_cm = numerical, continous
> Site/Block/Plot= factor
> Year = integer

  Fine, but REML=FALSE is unnecessary/irrelevant for generalized
linear mixed model (family!="gaussian") fits.

> 
> I get the following warning message:
> 
> 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) : singular convergence (7)
> 
> Is this due to the nature of my fixed/random factors or the way I put
> up the random factors?

  Hard to tell exactly.  It's probably due to overfitting and/or
lack of balance (glmer handles lack of balance, but extreme
lack of balance can lead to technical difficulties like this one).

> In lme I could include a component for autocorrelation,
> ex:cor=corAR1(form=~Year|Site/Block/ID). Does the equivalent exist for
> lmer?

   No, sorry.

   Crossed random effects are possible in lme (see p. 165?)
of Pinheiro and Bates 2000, and glmmPQL in the MASS package
can handle a Poisson response, so that might be the best way
to go.  However, I would also strongly encourage you to
do some graphical exploration of your data and make sure there
aren't outliers, almost-empty blocks, etc.

  Ben Bolker



More information about the R-help mailing list