# How to interpret sum contrast in regression (LMM)?

I am having difficulty understanding how the results from Linear Mixed Effects model. I am examining the three different types of learning condition, condition A, B, and C. My formula using Lme4 package is following:

fit <- lmer (dv ~ condition + (1|id))


I would like to set a model where I compare each learning condition with grand mean. So, I set a sum contrast.

condition <- factor (condition)
contrasts(condition) <- contr.sum(3)
fit <- lmer (dv ~ condition + (1|id))
summary(fit)


However, now I cannot find the condition C in the result. Where can I get the comparison between condition C and grand mean? This is how result supposed to be?

contr.sum makes sure all the contrasts sum to zero so that the "intercept" term is the grand mean. The effects are summarized with coefficients representing the number of factor levels ($k$) minus 1. In this case, the last level is dropped. The coefficients represent a mean difference from the "grand mean" for the first $k-1$ factor levels.
If you fit lm(y ~ x - 1) where $x$ has the sum contrast, then the model coefficients are the stratum specific means for each level of $x$, but the inference tests a mean difference from 0 for each level of $x$. This is useless unless $x$ is centered. I suggest you fit this model if you wish to simultaneously test the 3 parameters' difference from the grand mean. Technically speaking, this is overkill since such a model is overspecified, but that isn't inherently a bad thing.
• Hi, @adamO! I tried the -1 and it worked well! But, when I put two factors that have sum contrasts, I cannot compare the levels in the second factors with grand means, and the interaction also lacks each last levels in the both factors even though I specified no intercept model, i.e., lm(y ~ x * z -1) with x and y coded with sum contrast and the both factors have three levels for each). I tried lm(y ~ x * z -1 - 1), but it seems not working. Could you help me out with this too? Dec 30, 2017 at 20:21