[R-sig-ME] Mixed model interpretation with interaction

Emmanuel Curis emm@nue|@cur|@ @end|ng |rom p@r|@de@c@rte@@|r
Sun Jun 9 09:59:14 CEST 2019

Hello Patricia,

I think the interpretation of the fixed part is the same as for a
classical glm.  See below...

On Sun, Jun 09, 2019 at 09:16:43AM +0200, Patricia Graf wrote:
« Hello,
« I have a few questions concering the interpretation of a GLMM output table
« when the model includes an interaction.
« We want to analyse bear presence at feeding sites (bear_pres) related to
« the year (two years: 2016, 2017) and the feed supplied at feeding sites
« (carrion, maize). So the response is binary (0 = no bear present, 1 = bear
« present within 5-min intervals over the whole day) and both predictors are
« categorical, we include feeding site ID as random factor.
« 1) As I understand, in a model without interaction, the interpretation of
« the results would be as follows:
« M1 <- glmer((bear_pres ~  feed + year + (1|Feeding.site), family=binomial,
« data=df10)
« Fixed effects:
«            Estimate Std. Error z value Pr(>|z|)
« (Intercept) -4.58524    0.08529 -53.76   <2e-16 ***the intercept is bear
« presence at maize sites in 2016

More exactly, it is the log-odds of bear presence for an average site
where maize is supplied in 2016

« feedcarrion    0.39178    0.02139   18.32  <2e-16 ***bear presence at
« feeding sites in 2017 compared to 2016
« year2017    0.23027    0.01978   11.64  <2e-16 ***bear presence at carrion
« feeding sites compared to maize feeding sites

You have swapped the two lines. « feedcarrion » is the change in the
log-odds [that is, the log-odds ratio] when replacing maize by carrion
for a given site, both in 2017 and in 2016 since there is no
interaction; « year2017 », the same for 2017 vs 2016.

« Is this interpretation right?
« 2) To my knowledge, the output changes when you include an
« interaction:

Yes. Unless you have a perfectly null interaction in the sample, it
has to change, at least with default R coding for factors.

« M2<- glmer(bear_pres ~  year*feed + (1|Feeding.site), family=binomial,
« data=df10)
« Fixed effects:
«                   Estimate Std. Error z value Pr(>|z|)
« (Intercept)       -4.36413    0.10730 -40.67  < 2e-16 ***the intercept is
« bear presence at maize sites in 2016 (baseline)

Same remark as above.

« year2017          -0.18010    0.05119  -3.52 0.000434 ***difference in bear
« presence in 2017 compared to 2016 for maize
« feedcarrion          -0.02933    0.05318  -0.55 0.581222    difference in
« bear presence at carrion sites compared to maize sites in 2016
« year2017:feedcarrion  0.85275   0.09953    8.57  < 2e-16 ***difference in
« bear presence at carrion sites 2017 and the sum of ß0+ ß1+ ß2
« So to my questions: Is this interpretation right?


« What is the coding of the
« model so it does produce this output, e.g. why is the year not comparing
« 2016 to 2017 anymore as in the model without the interaction?

The model is, in the log-odds scale,
 y = ß0 + ß1 × 1(year = 2017) + ß2 × 1(feed = carrion)
        + ß3 × 1(year = 2017) × 1(feed = carrion)

where 1(x) is the « indicatrice » of x, that is the function equalling
1 if x is true, 0 otherwise.

« Or why
« doesn’t the model still use the two food types for comparison?

Because the interaction says that the comparison between years is
different for each food type, so a global comparison is (roughly
speaking) meaningless.

« As I understand, when you include an intercation between the two binary
« dummy-coded categorical variables, the interpretation of what was main
« effects before (year, carrion) changes, and so do the betas (these are
« called „simple effects“ afterwards).

The interpretation of what is a main effect does not really change,
but coefficients of the model do not correspond anymore to main
effects.  To have main effect evaluation, you should use suited
analysis of variance/deviance tables (see Type I, Type II, Type III
sums of squares and all these kind of things) or coefficients linear

« In my group, there is a strong believe that in M2, the year still compares
« the two years (and so does feed), it’s just the coefficient cannot be
« interpreted anymore. Also, there is a believe that the interaction term
« compares to feedmaize in the year 2016.

Not sure to understand, but seems wrong.

« If my interpreation is correct, I need some background on how the algorithm
« works, how simple effects evolve and why the interaction should be
« interpreted as in the output table of M2.

Read more about two-ways, 2×2 crossed factors, analysis of variance:
this is the basic and most simple case to understand interaction. Or
may be, as an alternative, analysis of covariance. Interpretation is
basically the same afterthat for glm/logistic regression, and when
adding random effects. Just a little bit more abstract because of the
change of the modeling scale (log-odds for glm/glmer here, for

Hope this helps,
Best regards,

                                Emmanuel CURIS
                                emmanuel.curis using parisdescartes.fr

Page WWW: http://emmanuel.curis.online.fr/index.html

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