Gamma Regression in Stan VERY different than Frequentist from lme4

From a quick glace I would say that you are comparing different models. In the Stan model you posted, you let the dispersion parameter \phi vary by group. Afaik this is not something lme4 can do.

Also, you might want to try non-centered parameterization for \alpha_{\text{group}}.

If you want what lme4::glmer is doing, you are probably better off just using rstanarm::stan_glmer. Is there any reason why you want to write this model yourself?

PS: you might also want to check out this recent thread.

1 Like