0
$\begingroup$

I have a binomial mixed effects model that was fitted as follows:

Exp1recog <- glmer(acc ~ neighb*(time+vocab) + (1+neighb|ID) + (1+vocab+time|item), data = recog, family = binomial, control = glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 2e5)))

(It predicts performance in a recognition task based on two within-subjects manipulations - neighb, time - and individual vocabulary ability.)

At the time, the vocabulary variable (continuous) was centered and scaled as follows:

recog$vocab <- scale(recog$vocabRaw, center = TRUE, scale = TRUE) 

I had written the scaled variable out to a csv file so that all the information for that particular analysis was together in one file. Now I'm tidying my code, I want to keep this information separate and create the centered scaled variable within the analysis script. This should be fine - I am using identical code to do so, and have done this with all my other analyses. However, this model is now failing to converge when using the new variable computed this way (but still converges with the variable imported from the csv).

Can anyone please offer any suggestions why?! The two vocabulary variables look identical, and I have ensured both are numeric. However, if I use a logical to test for equality between the two it returns false, and there are minuscule differences (biggest = 0.0000000004801795) between the two, I'm assuming due to rounding in the csv file. I can't see that those differences should cause problems? What else should I be checking?

I'm waiting for the moment when it's something obvious staring me in the face, but it's been a few days now and I'm baffled...

Many thanks in advance.

$\endgroup$

1 Answer 1

0
$\begingroup$

For future reference, we (semi-)fixed this by rounding our new vocabulary variable to the equivalent number of decimal places as the original one (9 decimal places), and it worked.

It seems odd/concerning that such tiny changes in precision should affect lme4 model fitting. Is this potentially a bug? Would welcome comments to help us understand why, but for now this issue is resolved.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.