[R-sig-ME] Graphing interaction terms in LME4, glmer

Ista Zahn istazahn at gmail.com
Tue Jan 29 00:13:49 CET 2013


Hi Shane,

Take a look at the effects package, I believe it has what you are
looking for. Here is a modified example from ?effect

library(lme4)

data(cake, package="lme4")
cake$a2 <- ifelse(cake$angle < mean(cake$angle, na.rm=TRUE), 0, 1)

fm1 <- lmer(a2 ~ recipe * temp + (1|recipe:replicate),
            data = cake,
            family = "binomial",
            REML = FALSE)

library(effects)
plot(effect("recipe:temp", fm1), grid=TRUE)


HTH,
Ista

On Mon, Jan 28, 2013 at 5:32 PM, Shane Gleason <sgleason at siu.edu> wrote:
> Hello everyone,
>
> I am working with lme4, specifically the glmer command.  In a multilevel
> model I have an interaction term which is significant. However, with my
> discipline we stress that an interaction term cannot be evaluated by p value
> alone and one must reference a graphical display of the interaction, with
> confidence intervals drawn around it.
>
> That is to say if the interaction is X*Z then the interaction might be
> significant when X=1 and Z=3, but may not be significant if X=4 and Z=9.
>
> I have searched around and I can't seem to find any indication of how to
> graph out the interaction (though I see some references to it for lmer (but
> never glmer)).  So, my question is two-part- 1: Does this assumption about
> how interaction terms work hold for MLMs?  2: If the answer to 1 is yes,
> does anyone know of software I can use to graph out these interactions?
>
> Thanks,
>
> Shane
>
> --
> Shane Gleason
> Doctoral Candidate
> Southern Illinois University:Carbondale
> Department of Political Science
> Faner 3172
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list