[R-sig-ME] unused argument(s) HELP

Douglas Bates bates at stat.wisc.edu
Wed Aug 15 23:12:33 CEST 2012


On Wed, Aug 15, 2012 at 3:09 PM, Karina Villegas <villegaskary at gmail.com> wrote:
> Thank you very much
>
> In the help of these functions, the maximum number of iterations by default
> is 50, but if I ask for a smaller number of iterations to my model, it shows
> me this error now:
>
>> LevelModel1 <- lme(PBC ~ Sex*Dur.nurse, random=~Sex|Trip, data=Dataset,
>> control=lmeControl(maxIter=50))
> Error in lme.formula(PBC ~ Sex * Dur.nurse, random = ~Sex | Trip, data =
> Dataset,  :
>   nlminb problem, convergence error code = 1
>   message = iteration limit reached without convergence (9)
>> LevelModel1 <- lme(PBC ~ Sex*Dur.nurse, random=~Sex|Trip, data=Dataset,
>> control=lmeControl(maxIter=49))
> Error in lme.formula(PBC ~ Sex * Dur.nurse, random = ~Sex | Trip, data =
> Dataset,  :
>   nlminb problem, convergence error code = 1
>   message = iteration limit reached without convergence (9)
>> LevelModel1 <- lme(PBC ~ Sex*Dur.nurse, random=~Sex|Trip, data=Dataset,
>> control=lmeControl(maxIter=40))
> Error in lme.formula(PBC ~ Sex * Dur.nurse, random = ~Sex | Trip, data =
> Dataset,  :
>   nlminb problem, convergence error code = 1
>   message = iteration limit reached without convergence (9)

If the algorithm reaches the maximum number of iterations then you
must increase that number from 50, not decrease it.

May I recommend that you install the lme4.0 package

install.packages("lme4.0")

and try instead

lmer(PCB ~ Sex*Dur.nurse + (Sex|Trip), Dataset)

and see what that does.  In a model like this it is unusual to need a
large number of iterations for the optimizer to converge unless the
model includes too many terms for the data available.

> 2012/8/15 Douglas Bates <bates at stat.wisc.edu>
>>
>> On Wed, Aug 15, 2012 at 2:08 PM, Karina Villegas <villegaskary at gmail.com>
>> wrote:
>> > Dear R experts:
>> >
>> > I am running R version 2.12.1 on Windows 2007. I am studying the effects
>> > maternal behavior in the body condition of sea lion pups from
>> > California.
>> >
>> > I specified my model as follows:
>> >
>> > LevelModel1 <- lme(PBC ~ Sex*Dur.nurse, random=~Sex|Trip, data=Dataset,
>> > max.iter=100)
>> >
>> > *See output below:*
>> > Error in lme(PBC ~ Sex * Dur.nurse, random = ~Sex | Trip, data =
>> > Dataset,  :
>> >   unused argument(s) (maxiter = 100)
>>
>> There is no maxiter argument to the lme function.  You want to specify it
>> as
>>
>> control=list(maxIter=100)
>>
>> (The upper-case 'I' in maxIter is important.)
>> > Anyone can help me with the error that makes the output? Please
>> >
>> > Thanks
>> > Karina
>> >
>> >
>> > --
>> > Biol. Karina Villegas Cervantes
>> > Estudiante de Maestría PCMyL - UNAM
>> >
>> > Laboratorio de Ecologia de Pinnipedos Burney J. Le Boueuf.
>> > CICIMAR-IPN
>> > Av. Instituto Politecnico Nacional s/n.Col.Playa Palo de Santa Rita
>> > La Paz Baja California Sur, Mexico.
>> >
>> >         [[alternative HTML version deleted]]
>> >
>> >
>> > _______________________________________________
>> > R-sig-mixed-models at r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> >
>
>
>
>
> --
> Biol. Karina Villegas Cervantes
> Estudiante de Maestría PCMyL - UNAM
>
> Laboratorio de Ecologia de Pinnipedos Burney J. Le Boueuf.
> CICIMAR-IPN
> Av. Instituto Politecnico Nacional s/n.Col.Playa Palo de Santa Rita
> La Paz Baja California Sur, Mexico.
>



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