I have a categorical fixed effect with 3 levels that I'm trying to enter into an LME.

a = lmer(Reaction ~ ContinuousEffect * CategoricalEffect + (1|Subject) + (1|StrengthOfStimulus))

StrengthOfStimulus is a numerical variable that's being used as a random effect, along with Subject.

Now, for some reason, when I run this model I only get information on two levels of the CategoricalEffect, when there are really three levels:

Fixed effects:
              Estimate Std. Error t value
(Intercept)   6.853550   0.035681  192.08
ContinuousEf -0.005463   0.002046   -2.67
TypeB        -0.213765   0.010707  -19.97
TypeC        -0.198775   0.010595  -18.76

Where A, B, and C are the levels of the CategoricalEffect.

What happened to level A?


1 Answer 1


In general, in a model which includes the intercept term (as yours does), the effect of a categorical predictor with k levels can be represented with k-1 codes. So, as expected, the effect of your 3-level predictor is represented with 2 codes (plus the intercept term). In this case, they appear to be "dummy codes," where the intercept represents the predicted value for a baseline category, here level A, and the two codes represent the deviations of the other groups from the baseline category.

None of this is specific to either lmer() or to mixed-effects models more generally; it is basic ANOVA theory.

  • 3
    $\begingroup$ To see exactly how the contrasts are specified, try running contrasts(CategoricalEffect). You should see two columns of contrasts coefficients, where A is set to 0 in each column, and therefore acts as the reference level for both comparisons. $\endgroup$
    – Marius
    May 8, 2012 at 4:12

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.