[R-sig-ME] Convergence error issues
Andrew Robinson
A.Robinson at ms.unimelb.edu.au
Sat Sep 10 01:25:26 CEST 2011
Hi Katrina,
briefly, no, not necessarily trying to test too many things. Model
fitting for mixed-effects models is an iterative procedure, and the
package authors have thoughtfully put in limits as to how many times
the algorithm should iterate before deciding to quit. You can ask the
algorithm to try for longer. I often have to do that. The fitting
algorithm for lmer is different than that for lme, so it is not
surprising that it behaves differently.
Try reading chapter 12 of the (ok, my) icebreaker document. You can
get it from here:
http://www.ms.unimelb.edu.au/~andrewpr/r-users/icebreakeR.pdf
I hope that this will help.
Cheers
Andrew
On Fri, Sep 09, 2011 at 02:58:54PM +0100, Katrina Evans wrote:
> Hi,
>
> I am relatively new to R, so please bear with me if this question is too
> simplistic/flawed!
>
> I have a radio telemetry dataset with the foraging distances of a number of
> birds. Birds are grouped into one of 5 categories depending on their
> breeding status, for example females with eggs, females with chicks, paired
> males, unpaired males. Here is a sub-set:
>
> Distance travelled (m) Bird_id Date Bird Status
> 1400 A 13/5/09 Female with chick
> 300 A 14/5/09 Female with
> chick
> 200 B 13/5/09 Paired male
> 1400 B 14/5/09 Paired male
> 356 C 13/5/09 Unpaired male
>
> etc etc
>
> I have 30 birds in total and they were tracked for 3 months altogether, with
> around 10 distances obtained per bird per night.
>
> My main question is are birds of different breeding status travelling
> different distances to forage? As I have repeated observations for each
> bird, I decided to do a mixed model with bird id as a random effect. (I
> haven't included the issue of date yet as I wanted to try the simplest model
> first).
>
> I decided to look at a random intercept model and a random intercept and
> slope model, using lme.
>
> I tried the following:
>
> Mlme1<-lme(Sqrt_Distance~Status,random=~1|fBird_ID,data=Distance)
> Mlme2<-lme(Sqrt_Distance~Status,random=~1+Status|fBird_ID,data=Distance)
> The first model worked, however for the second, I got the error message: nlminb
> problem, convergence error code = 1, message = iteration limit reached
> without convergence (10).
> I am wondering if this is because I'm trying to test too many things with
> too small a dataset?
>
> I then tried the same thing using lme4 this time, and both models worked
> with no error messages.
>
> Mlmer1<-lmer(Sqrt_Distance~Status+(1|fBird_ID),data=Distance)
> Mlmer2<-lmer(Sqrt_Distance~Status+(Status|fBird_ID),data=Distance)
>
> Is this because lme4 can deal with this kind of data better or is there
> still a flaw in the model process?
> I would like to see if date is having an effect on the distance travelled
> too, but at the moment, I'd just like to see if I am going about this the
> correct way.
>
> Thank you in advance for any help,
> Katrina
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
--
Andrew Robinson
Deputy Director, ACERA
Department of Mathematics and Statistics Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/
Forest Analytics with R (Springer, 2011)
http://www.ms.unimelb.edu.au/FAwR/
Introduction to Scientific Programming and Simulation using R (CRC, 2009):
http://www.ms.unimelb.edu.au/spuRs/
More information about the R-sig-mixed-models
mailing list