0
$\begingroup$

I am building a linear mixed effect model using the lmer function from the lme4 package in R but I am struggling to interpret the interactions terms in the model. I have used the following syntax:

mod2 <- lmer(post.diff ~ #my predicted DV
            course * group
             #my fixed effects
             + (1|bib)
             #my random effects
             , dat, REML = FALSE)

The two factors - course and group - are dummy coded variables. This gives me the following output:

Fixed effects:
               Estimate Std. Error       df t value Pr(>|t|)    
(Intercept)    -0.26080    0.18036 56.22506  -1.446    0.154    
courseB         0.87647    0.09257 94.00000   9.468 2.49e-15 ***
courseC         2.38860    0.09257 94.00000  25.802  < 2e-16 ***
group1         -0.20996    0.26361 56.22506  -0.796    0.429    
courseB:group1  0.09664    0.13531 94.00000   0.714    0.477    
courseC:group1  0.10678    0.13531 94.00000   0.789    0.432   

Using the anova() function, I can see that there is no main effect of group nor any interactions:

Type III Analysis of Variance Table with Satterthwaite's method
              Sum Sq Mean Sq NumDF DenDF  F value Pr(>F)    
course       142.305  71.152     2    94 664.1974 <2e-16 ***
group          0.034   0.034     1    47   0.3188 0.5750    
course:group   0.081   0.041     2    94   0.3795 0.6853   

Still, I want to better understand how I can interpret the output from my model. From my understanding:

-0.26080 (intercept) is the estimated mean for the group codes with 0 in course A

0.87647 is the estimated simple slope for the group codes with 0 in course B

2.38860 is the estimated simple slope for the group codes with 0 in course C

-0.20996 is the estimated simple slope for the group codes with 1 in course A

My question is how I should interpret the interactions terms in the model. I hope someone can help me so that I can see it an equation form.

$\endgroup$

1 Answer 1

2
+50
$\begingroup$

I'm going to change the terminology a bit as I find that talking consistently and explicitly about coefficients representing differences in associations with outcome under treatment/dummy coding help a lot when you get to the level of interactions. I'll keep your interpretation of the intercept, but from there on I recommend saying:

0.87647 is the estimated difference between course B and course A for group 0;

2.38860 is the estimated difference between course C and course A for group 0;

-0.20996 is the estimated difference between group 1 and group 0 in course A.

Then the interpretation of interaction coefficients is just in terms of the next level of differences in estimates.

The courseB:group1 interaction of 0.09664 is the extra estimated difference from course A and group 0 beyond the sum of individual differences associated with group B and group 1 above, and:

the courseC:group1 interaction of 0.10678 is the extra estimated difference from course A and group 0 beyond the sum of individual differences associated with group C and group 1 above.

Some find that writing things out explicitly in terms of the 0/1 False/True entries used in the dummy-coded design matrix helps with understanding. For fixed effects you have the following model, with 0/1 coding except for intercept, and * representing actual multiplication (not the R expansion into individual and interaction terms):

outcome ~ intercept + isCourseB + isCourseC + isGroup1 + (isCourseB * isGroup1) + (isCourseC * isGroup1)

with the corresponding coefficients in the order shown in your summary display. Each interaction term is non-zero only when both of the individual dummy codings is non-zero. Reading left to right shows how each coefficient represents a difference from what had already been predicted. This can extend to higher-order interactions if present in a model.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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