I'm analysing my data using linear mixed effects models and I have noticed that the high estimated correlation of fixed effects may be indicating some collinearity problem:

Correlation of Fixed Effects:
            (Intr) typcmp gpbjct
typecomplex -0.588              
gapobject   -0.588  0.500       
typcmplx:gp  0.416 -0.707 -0.707

I've centered the predictors using the following code:

datsub$c.gap = factor(datsub$gap)
contrasts(datsub$c.gap) = c(1, -1)

datsub$c.type = factor(datsub$type)
contrasts(datsub$c.type) = c(1, -1)

I've run my model again, and now the correlation of fixed effects seems to be zero:

Correlation of Fixed Effects:
            (Intr) c.typ1 c.gap1
c.type1     0.000               
c.gap1      0.000  0.000        
c.typ1:c.g1 0.000  0.000  0.000

Is this even possible? Am I centering my predictors in the wrong way?

  • $\begingroup$ Do you have a balanced design? If so i would have thought it was possible. If you are not sure what I mean then show us the result of cross-tabulating type with gap. $\endgroup$
    – mdewey
    Nov 15, 2016 at 15:09
  • $\begingroup$ Yes, I think I have a balanced design, I have approximately the same number of data points by condition (gap and type, each of them with two levels), between 13 and 16 data points per level and item. $\endgroup$
    – serlosan
    Nov 15, 2016 at 15:20

1 Answer 1


It appears you are using R. The code you show does not center your variables, it makes them factors (or does nothing if they were factors already). To center a variable, you subtract the variable's mean from every value. In your case, your use of contrasts() after turning the variables into factors does center them on $0$. If all your covariates are centered, it will make your variables uncorrelated with your intercept (cf., Why does the standard error of the intercept increase the further $\bar x$ is from 0?), but wouldn't make them uncorrelated with each other if they were correlated before centering. If you have categorical variables (factors), and you have equal $n_{ij}$s in every cell, your variables will also be perfectly uncorrelated (and uncorrelated with the intercept, since the intercept is then just the reference level of your factors). That should be true whether you use effect coding (1, -1) or reference level coding (0, 1).

  • 3
    $\begingroup$ Note how they set the contrasts after creating the factors. $\endgroup$
    – Roland
    Nov 15, 2016 at 15:45
  • $\begingroup$ Good point, @Roland, I'll edit. $\endgroup$ Nov 15, 2016 at 15:49
  • $\begingroup$ Thank you so much for your answers. The first output I report above corresponds to a model where variables are dummy coded (0, 1). The second output corresponds to the same model using effect coding (-1, 1). We expected that centering our categorical variables would indeed reduce (high) collinearity problems somehow, but we wonder whether a zero correlation makes sense at all. See, for example, that in our second output we get no correlation between type and type*gap. $\endgroup$
    – serlosan
    Nov 15, 2016 at 16:08
  • $\begingroup$ @serlosan, if the design is balanced, there should be no correlation even when using reference level coding. Are you sure they were coded correctly before? Can you post your data? $\endgroup$ Nov 15, 2016 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.