# How to deal with collinearity in lme with categorical IV with > 2 levels

I'm analysing data from our experiment. We had participants in 4 groups, each participant was measured 4 times. We measured cortisol in saliva, so it leads us to the linear mixed models, because the individual cortisol levels have different slopes. I have fitted following model:

lmer1 <- lmer(Cortisol ~ group*measurement + (1|id), data=df)


I used treatment codig for both categorical variables, because we are interested in differences between 1st measurement in first group with other measurements.

My problem is, that I get strong correlations between factor levels and I'm not sure, how to solve it. Contrast coding would be one solution, but it would answer different question (as I said, we want to compare differences between 1st group,1st measurement and all the others).

This is my correlation matrix for fixed effect from lmer method (lme4 package):

          (Intr) group2 group3 groupP msrmn2 msrmn3 msrmn4 grp2:2 grp3:2 grpP:2 grp2:3 grp3:3 grpP:3 grp2:4 grp3:4
group2      -0.770
group3      -0.650  0.500
groupP      -0.557  0.429  0.362
measuremnt2 -0.602  0.464  0.391  0.335
measuremnt3 -0.598  0.460  0.388  0.333  0.521
measuremnt4 -0.602  0.464  0.391  0.335  0.524  0.521
grp2:msrmn2  0.461 -0.600 -0.299 -0.257 -0.765 -0.398 -0.401
grp3:msrmn2  0.390 -0.300 -0.589 -0.217 -0.647 -0.337 -0.339  0.495
grpP:msrmn2  0.329 -0.253 -0.214 -0.578 -0.546 -0.284 -0.287  0.418  0.353
grp2:msrmn3  0.461 -0.599 -0.300 -0.257 -0.402 -0.772 -0.402  0.519  0.260  0.220
grp3:msrmn3  0.383 -0.295 -0.579 -0.213 -0.333 -0.641 -0.333  0.255  0.501  0.182  0.495
grpP:msrmn3  0.333 -0.256 -0.216 -0.585 -0.290 -0.557 -0.290  0.222  0.188  0.499  0.430  0.357
grp2:msrmn4  0.462 -0.598 -0.300 -0.257 -0.402 -0.399 -0.767  0.518  0.260  0.220  0.518  0.256  0.223
grp3:msrmn4  0.390 -0.300 -0.589 -0.217 -0.339 -0.337 -0.647  0.260  0.510  0.185  0.260  0.501  0.188  0.496
grpP:msrmn4  0.329 -0.253 -0.214 -0.578 -0.287 -0.284 -0.546  0.219  0.185  0.493  0.220  0.182  0.499  0.419  0.353


Do you have suggestions about how to solve this (reduce collinearity/ignore it)?

• This is not a "problem" and does not need to be "solved." As you already noted yourself, this apparent multicollinearity is a natural consequence of using dummy codes. If you use non-orthogonal codes, you get non-orthogonal parameter estimates. My advice: ignore it. – Jake Westfall Oct 21 '13 at 10:16
• Ok, Thanks a lot! I thought that it should be ok, but I just want to be sure:-) – fidadoma Oct 21 '13 at 12:10
• @JakeWestfall , post as solution? – Ben Bolker Oct 26 '13 at 18:12