1
$\begingroup$

I have two, three-level, categorical variables in R. Both are reference coded using level 1. I run a mixed effects linear regression using trial level data.

The R output provides separate interaction terms for each level of the predictors. For example, terms for:

Level 2 of A X Level 2 of B

Level 3 of A X Level 2 of B

Level 2 of A X Level 3 of B

Level 3 of A X Level 3 of B

First of all, I have some trouble wording what these interactions mean in my personal dialogue. For instance, imagining that the first interaction is significant, it wouldn't be correct to say that "the effect of variable A depends on variable B" because the test is for specific levels of each. Would one say "the effect of level 2 of variable A (relative to level 1) depends on the effect of level 2 of variable B (relative to level1)"? This is quite difficult for me to grok.

In any case, assume again that this interaction is significant. What is the correct follow up? Is it to look at the effect of Variable B (level 2 vs 1) separately for levels 2 and 1 of Variable A? I.e., completely ignoring trials with level 3 of either variable, and essentially following up as though this were a 2 x 2 interaction.

$\endgroup$
1
$\begingroup$

In order to better understand this, let's create a toy example where we are feeding fish two different types of food (Food A and Food B), each at three different levels (Low, Medium, and High). The Response variable we are measuring is how many fish survive after a week of feeding.

For example, let's say we have the following type of data.

Alive   Food Level A    Food Level B
0       Low             Low
24      Low             Medium
100     Medium          Medium
24      Medium          Low
98      High            Low
74      High            Medium
98      Low             High
76      Medium          High
52      High            High

Intuitively, fish need some food to survive, but not too much food (overfeeding). So the effect of the level of Food A we give depends on the level of Food B, so there will be an interaction. If we feed a lot of Food A (Food A High) when Food B is Low, then the fish will be fine (a positive effect for BHigh at the baseline of BLow) . If we feed a lot of Food A (Food A High) when Food B is High, the fish will be overfed (and some die, a negative interaction between AHigh and BHigh). If we feed a moderate amount of Food A (Medium) when Food B is Medium, the fish will be fine (positive interaction for AMedium and BMedium).

Fitting this data in R and looking at the summary output shows output that coincides with our intuition.

rep(c("Low","Low","Medium","Medium","High","High","Low","Medium","High"),2)
A = relevel(factor(A),ref=2)
B = rep(c("Low","Medium","Medium","Low","Low","Medium","High","High","High"),2)
B = relevel(factor(B),ref=2)
Response = c(1,24,100,24,98,74,98,76,52,0,26,100,25,99,74,100,74,48)
dat = data.frame(Response,A,B)
mod1 = lm(Response~A*B, data=dat)
plot(mod1)


 Coefficients:
                Estimate Std. Error t value Pr(>|t|)    
(Intercept)        0.500      0.928   0.539    0.603    
AHigh             98.000      1.312  74.676 7.00e-14 ***
AMedium           24.000      1.312  18.288 2.00e-08 ***
BHigh             98.500      1.312  75.057 6.69e-14 ***
BMedium           24.500      1.312  18.669 1.67e-08 ***
AHigh:BHigh     -147.000      1.856 -79.206 4.13e-14 ***
AMedium:BHigh    -48.000      1.856 -25.863 9.31e-10 ***
AHigh:BMedium    -49.000      1.856 -26.402 7.75e-10 ***
AMedium:BMedium   51.000      1.856  27.480 5.43e-10 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.312 on 9 degrees of freedom
Multiple R-squared:  0.9993,    Adjusted R-squared:  0.9987 
F-statistic:  1618 on 8 and 9 DF,  p-value: 2.742e-13

In other words, there is an interaction between Treatment A and Treatment B, which means the effect of a given level of Treatment A depends on the corresponding level of Treatment B.

$\endgroup$
  • $\begingroup$ Thanks for the reply. In your example, what would be the correct follow up to an interaction between AMedium:BMedium? Would it be to eliminate trials of AHigh and BHigh, and to look at the effect of AMedium vs Low at BLow and BMedium? Or would it be to look at the effects of both AHigh vs Low and AMedium vs Low at BLow and BMedium? $\endgroup$ – Dave Jun 4 '18 at 17:15
  • $\begingroup$ That depends on the purpose of your research. Generally, you've determined and quantified the interaction by including it in your model. From the information you provided, I don't see a reason for any follow-up at all. Are you conducting more trials? Are you trying to best explain the interaction in a graph? Is there a specific interaction that is of research importance? I'm trying to understand why you feel follow-up is necessary. $\endgroup$ – Underminer Jun 5 '18 at 13:18

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.