Problem fitting glmer model with factor and numeric predictors

I'm trying to fit logistic regression with formula like this:

mod <- glmer(response ~  factor1+factor2+numeric1+numeric2+numeric3+numeric4 +(1|factor3),
data=myDataset,family = binomial,
control=glmerControl(optimizer="bobyqa"))


Factor1 and factor2 are categorical variables with (5 and 2 categories). Factor3 is id of subject. The rest of predictors are numeric variables - all of them scaled with scale().

I am getting following error/warning:

Warning messages:
1: Some predictor variables are on very different scales: consider rescaling
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
Model failed to converge with max|grad| = 0.406353 (tol = 0.001, component 1)
3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?;Model is nearly unidentifiable: large eigenvalue ratio
- Rescale variables?


When I am trying to fit the model without factor1 and factor2 variables, model fits without complain, so I am assuming that problem is in my factor predictors. But I have no idea how to fix it. Should I recode my factor variables to dummy variables myself and then scale them? Will it help? Any idea will be very appreciated.

• Can you confirm that R is storing your factor variables as "factors" in the dataset? e.g.(str(myDataset)). How many observation do you have nested per person? How many individuals overall? And how much variability is there in your DV? Just curious in terms of trying to reproduce all of the conditions for this example. – Matt Barstead Jul 5 '17 at 4:35
• Matt, thank you for comments. I can confirm that R is storing factors I mentioned as factors. I have 21 individuals overall with min 10, max 103 observations, average 24 observations and standard deviation 19.95 . – makak Jul 6 '17 at 4:15
• Is there any chance you can provide any additional summary info for all variables in the model and/or something like the first 25 rows of data? – Matt Barstead Jul 7 '17 at 15:00
• At first instance try using scale(numeric1)+scale(numeric2)+scale(numeric3)+scale(numeric4) instead of numeric1+numeric2+numeric3+numeric4 and see if rescale your numerical variables help. – usεr11852 says Reinstate Monic Jul 8 '17 at 10:09