0
$\begingroup$

I am running a logistic mixed model regression using lme4::glmer Command.

I wanted to report AME (average marginal effect for my coefficients). I used the following command (lme4 package's manual says it works for glmer so why not use that?): margins::margins

I have seen threads of questions and answers with similar topics that suggest: ggeffects::ggpredict

My problem is that ggpredict does not provide AMEs. It just gives me predictions for 50 levels of my independent variable.

Which one should I use and why? lme4 package's manual says it workd for glmer so why not use that? Why do people use and suggest ggeffects instead?

$\endgroup$
  • $\begingroup$ Define your AME in terms of distribution parameters ore function of distribution parameters, then it is not hard to get the estimate of AME given you can get the estimate of parameters through logistic regression. $\endgroup$ – user158565 Jul 19 at 2:48
2
$\begingroup$

You can also obtain coefficients from a generalized linear mixed model that have the desired marginal interpretation. These coefficients are provided by function marginal_coefs() of the GLMMadaptive package. For an example, check here.

$\endgroup$
  • $\begingroup$ it is not working: Error in UseMethod("marginal_coefs") : no applicable method for 'marginal_coefs' applied to an object of class "c('glmerMod', 'merMod') $\endgroup$ – UseR2001 Jul 26 at 1:39
  • $\begingroup$ You have to fit the model using the mixed_model() function of the GLMMadaptive package. $\endgroup$ – Dimitris Rizopoulos Jul 26 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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