# interpreting intercept in lme4 when having within and between subjects variables and interaction

I am testing the effect of priority (which is a continuous within subjects factor) and viewing condition (which is a factor and a between subjects factor with 2 levels) on error. So the condition factor was coded with 0 being the free viewing condition and 1 being the fixed viewing condition. I am also investigating the interaction between priority and viewing condition. I used the following code:

Mag2 = lmer(Error ~ Priority*Condition + (1|Subject), data = Magnitude, REML = FALSE)
anova(Mag2)


And I get the following output about fixed effects:

Fixed Effects:
(Intercept)                 Priority           Conditionfixed
75.9227                  -0.4155                  -9.4225

Priority:Conditionfixed 0.2342


I know that since condition is a factor with two levels and I coded it in the above way, the (Intercept) refers to free condition while Conditionfixed refers to fixed condition. So I know by looking at the averages that I have more error in the fixed condition than in the free so i would expect the Conditionfixed value to be positive. But here is negative? Why is that? Am I interpreting it in a wrong way?

Thank you

• Correction: So the condition factor was coded with 1 being the free viewing condition and 2 being the fixed viewing condition. Commented Jul 14, 2021 at 11:40

Which averages are you comparing, exactly? More specifically, with which Reputation values?

Assuming free viewing is the reference condition, I think the answer may be in the interaction term: for each increment of Priority with 1 unit, there is a decrement of -0.4155 for the free viewing condition, while the decrement is limited to -0.4155 + 0.2342 = -0.1813 for the fixed viewing condition. So provided Reputation scores are sufficiently high, this difference could more than compensate the between condition intercept.

• (+1) Nice answer. I have a few comments that I'll put in an answer.. Commented Jul 22, 2021 at 18:57

This is more of a comment/expansion on the excelent answer by @KrisBae which I recommend you accept. This model has the following features:

• Global intercept: 75.9

• This is the expected value of Error when Priority is 0, in Free Condition group.
• Main effect for Priority: -0.4155

• This is expected change in Error for a 1 unit change in Priority (ie. the slope for Priority) in the Free Condition group.
• Main effect for Condition: -9.4225

• This is expected difference in Error between Condition = Free and Condition = Fixed, when when Priority is 0
• The interaction term Priority:Condition: 0.2342

• This is the expected difference in the slope for Priority between the two  Condition s), so that the slope for those in the Fixed Condition group is -0.4155 + 0.2342 = 0.1813

It might make more sense for your interpretation if you centre the Period variable (depending on it's range - I guess it might be centred or otherwise transformed already). If you centre it, say at the grand mean, then rather than the other estimates being conditional on Period being zero, they are conditional on Period being at it's mean.

• Please take your time to read through @Robert Long s crystal clear explanation. E.g., the intercept value does not reflect the average for your free viewing condition disregarding priority (unless you centered it), it reflects the pedicted value in that condition when priority = 0. Commented Jul 26, 2021 at 11:01