[R-sig-ME] Marginal effect plot for an interaction effect from GLMM following a beta-distribution (glmmTMB)
John Fox
j|ox @end|ng |rom mcm@@ter@c@
Tue Oct 20 00:30:04 CEST 2020
Dear Jan,
Though I haven't tried it, I believe that the functions in the effects
package should work with a glmmTMB model of this structure.
Note that you're using the * operator in the model formula incorrectly
(i.e, redundantly) -- your fixed-effects specification is equivalent to
ref_turnout ~ contestation + experience_with_ref * unemployment .
I hope this helps,
John
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/
On 2020-10-19 4:21 p.m., Jan anye Velimsky via R-sig-mixed-models wrote:
>
> Dear R project mixedmodels users,
>
> I am struggling to estimateand visualize the marginal effects
> (interaction effect) from a GLMM Model.
>
> We have been estimatinga GLMM model following a beta-distribution with
> the glmmTMB-package. The model consistsof factors influencing referendum
> turnout (range between 0-1) in german municipalities.The primary units
> of investigation are city districts nested in referendumsnested in cities.
>
> Here an example model:
>
> model1 <- glmmTMB (ref_turnout ~ unemployment + contestation+
> experience_with_ref + (experience_with_ref *unemployment)+ (1| town/
> referendum), family=list(family="beta", link ='logit'), data = ml)
>
>
>
> Results example model:
>
> Estimate Std. Error zvalue Pr(>|z|)
>
> (Intercept)
> -0.583 0.131 -4.455 8.4e-06***
>
> unemployment
> -0.067 0.002 -30.397 < 2e-16 ***
>
> contestation
> 0.008
> 0.003 2.398 0.0165 *
>
> experience_with_ref 0.012
> 0.052 0.228 0.8200
>
> unemployment: experience_with_ref
> -0.001 0.001 -1.725 0.0845 .
>
>
>
> The model contains an interaction effect with unemploymentper district
> and experience with referendums in the respective city.
>
> The aim is to visualize the interaction effects plotting the marginal
> effects.
>
> With the "marginal_effects" command from the (margins-package) it was
> possible to estimate marginal effects,but no further summaries which are
> needed for plotting the model. The "margins" command does not work for
> the glmmTMBmodel. The idea is to have a simplemarginal effects plot for
> the interaction effect like this:
>
>
> Thanks a lot for your help!
> Jan Velimsky
>
> -- Jan Velimsky, MAResearch associate
> Ludwig-Maximilians-Universität Munich
> Geschwister-Scholl-Institut of Political Science (GSI)
> Oettingenstrasse 67
> D-80538 Munich
>
>
>
>
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> <https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>
More information about the R-sig-mixed-models
mailing list