# lme4: prevent 'glmer' to have zero estimated random coefficient

I use the glmer function with the Poisson family from lme4. My simulated data are constituted of 3600 individuals, and a variable A with 30 levels and a second variable B with 2 levels. I have simulated random effects for the 2 variables from Normal distribution whose standards deviation are equal to 0.5 (far from zero!).

In the model, the random effets are of the form: (0 + B | A ) + (1| A )

(The complete model is of the form: event ~ -1 + cov1 : factor(B) + cov2 + offset(log(time))+ (0 + B | A ) + (1| A ) . cov1 is categorical variable. cov2 is a binary covariate. Both are fixed effects)

Despite this, the model estimates the second random coefficient at zero in 70% of the simulations, which for me is a failure.

Does anyone have any advice to prevent the model from estimating the random coefficients at zero, maybe by changing the parameters of the Control? I don't want to simplify the model, I need it to be in the above formulation. I tried the two optimizers (Nelder-Mead and bobyqa); there was no change in the proportion of failures.

Thanks a lot for any help,

• I think you will need to provide more details, ideally your simulation code. – Robert Long Jul 8 at 15:07
• @RobertLong I can provide it with pleasure but it is very long... – Flora Grappelli Jul 8 at 15:20
• Perhaps you can simplify it to demonstrate the problem ? – Robert Long Jul 8 at 15:40
• @RobertLong Everything is now available – Flora Grappelli Jul 8 at 15:53
• Why aren't the individuals represented in the random effects structure? Reading the question. A and B sound like fixed effects. – JTH Jul 9 at 16:05

In particular, the advice to use the "blme" package was a great help to me. This solved all my problems with the random coefficient estimated at zero. Note that this package is very easy to use when you are used to lme4.