Let's say you're trying to fit a model to a dataset that includes categorical variables, group (A or B) and treatment (1, 2, 3 or 4).
In R, your model formula would be DV ~ group * treatment (DV stands for dependent variable) and your model output will look like this:
(intercept) [...]
groupB [...]
treatment2 [...]
treatment3 [...]
treatment4 [...]
groupB:treatment2 [...]
groupB:treatment3 [...]
groupB:treatment4 [...]
My question is how to interpret this kind of output. Below is what I believe is right for the interpretation of the main effects, and what puzzles me about the interaction parameters.
(intercept)
This the reference value, i.e. for treatment 1 in group A.
groupB
This is the difference between group A and group B for treatment 1 only.
treatment2
This is the difference between treatment 1 and treatment 2, within group A only. It indeed still refers to the intercept value. Same logic for the two following estimates ("treatment3" and "treatment4").
groupB:treatment2
Here is where I get puzzled. Is this testing if the difference between treatment1 and treatment2 is the same in groupB compared to groupA, or is it testing if if the difference between groupA and groupB is the same for treatment1 compared to treatment2.
I thought this question would be very basic, but I went through several R books with no luck and found inconsistent answers on here (see How to interpret 2-way and 3-way interaction in lmer? for support for the first idea and Interpreting the regression output from a mixed model when interactions between categorical variables are included for the other way).
If that matters, I'm working with the glmer function of the lme4 package.
Thanks!
sjp.int
function of the sjPlot-package (see examples here). Maybe this blog-posting is also helpful. $\endgroup$