In specifying a crossed mixed effects model, I am trying to include interactions. However, I get the following error message:
Error in lme.formula(rate ~ nozzle, random = ~nozzle | operator, data = Flow) : nlminb problem, convergence error code = 1 message = iteration limit reached without convergence (10)
The model has the following:
1. 3 nozzle types (fixed effect)
2. 5 operators, each with 3 repeat measures on fuel flow from the 3 nozzle types.I was asked to include the interaction between nozzle type and operator in the model.
This is my code for the model:flow.lme <- lme(rate ~ nozzle, error= nozzle|operator, data=Flow)
Why would I get this error message??
Answer
I haven’t heard of the error
argument to lme
and I don’t see it in the documentation. Are you sure that isn’t a typo? But, to answer the question you asked:
Try ?lmeControl
Setting the maxIter
, msMaxIter
, niterEM
, and/or msMaxEval
arguments to higher values than the default may fix this. Capture the output from lmeControl
to an object and then pass that object to the control
argument of lme
.
Or…
The new default optimizer lme
uses is flaky. Half the time these sorts of problems get solved for me when I change it back to the old optimizer. You do this by setting the opt
argument for lmeControl
to 'optim'
.
So, putting it together:
ctrl <- lmeControl(opt='optim');
flow.lme <- lme(rate ~ nozzle, error= nozzle|operator, control=ctrl, data=Flow);
Attribution
Source : Link , Question Author : Tal Bashan , Answer Author : f1r3br4nd