Search

Search papers and lessons

Multicollinearity

Level 2 · 10 min read

Multicollinearity means two or more predictors in a regression carry nearly the same information, which leaves their individual effects poorly determined even when the model still predicts well.

On this page

  • Colour = topic mix
  • Discrete math
  • Probability
  • Linear algebra
  • Calculus
  • Classical models
  • Losses & regularization
  • ReadReady to readNot yet

TL;DR

Multicollinearity is the situation in a regression where two or more predictors move together so closely that they carry almost the same information. The model can still predict well, but the separate effect of each predictor becomes unstable, with large uncertainty and sometimes the wrong sign. It matters because people read individual coefficients as "the effect of this variable", and that reading breaks down here.

Builds on: Linear Regression, Linear Independence · Leads to: ridge regression, variance inflation

Where it's used

  • Housing prices. A model of house price might include both floor area in square metres and the number of rooms. Bigger houses usually have more rooms, so the two predictors are strongly correlated. The model can price houses well, but the separate effect of "one more room" is hard to pin down.
  • Economics and social science. Income, education and occupation are often correlated. A study that wants the effect of education alone has to deal with the fact that education and income rise together in the data.
  • Biology and medicine. Measurements such as body mass and waist size are closely linked. Researchers who include both in a model should expect their separate coefficients to be shaky. This is a statistical point about models, not advice about any person's health.

How it works

Here is a tiny data set for a regression with two predictors, x1x_1 and x2x_2, and one outcome, yy. The predictor x2x_2 is exactly twice x1x_1.

x1x_1x2x_2yy
123
245
367
  1. Write the model. y=b0+b1x1+b2x2y = b_0 + b_1 x_1 + b_2 x_2. We want b1b_1 and b2b_2.
  2. Look at the predictors. Every row has x2=2x1x_2 = 2x_1. The two columns carry the same information. Any change in x1x_1 comes with an exactly matched change in x2x_2.
  3. Ask what the data can say. Many different pairs of effects fit the data equally well. For example, b1=2,b2=0b_1 = 2, b_2 = 0 and b1=0,b2=1b_1 = 0, b_2 = 1 both give the same predictions, since 2x12x_1 and x2x_2 are identical on this data.
  4. Check the arithmetic. The method of least squares needs to invert a matrix built from the predictors. Here that matrix has determinant zero, so it cannot be inverted, and the coefficients are not uniquely determined.
  5. Conclude. The predictions are fine, but the split of credit between x1x_1 and x2x_2 is not decided by the data at all.

Check: real data is rarely this exact. The more the predictors agree, the closer the determinant comes to zero, and the less certain the split becomes. The next sections show how to measure that.

flowchart LR
  A[Predictors x1 and x2 move together] --> B[Their columns are nearly parallel]
  B --> C[Matrix to invert is nearly singular]
  C --> D[Coefficients have large uncertainty]
  D --> E[Predictions still fine, single effects unstable]

The math

Write the data as a matrix XX with nn rows (observations) and pp columns (a column of ones for the intercept plus the predictors). The ordinary least squares solution is

β^=(X⊤X)−1X⊤y\hat{\boldsymbol{\beta}} = (X^\top X)^{-1} X^\top \mathbf{y}

The matrix X⊤XX^\top X, the transpose of XX times XX, is the one that must be inverted. Multicollinearity is a statement about how close it is to being singular.

Step 1 in symbols: the matrix is nearly singular

For the tiny data set, the entries of X⊤XX^\top X for the two predictors are the sums of squares and cross-products. To keep the matrix 2×22 \times 2, this step leaves out the intercept column. With the intercept, the 3×33 \times 3 matrix is also singular, because x2−2x1=0x_2 - 2x_1 = 0 is still a linear dependence.

∑x12=14,∑x1x2=28,∑x22=56\sum x_1^2 = 14, \qquad \sum x_1 x_2 = 28, \qquad \sum x_2^2 = 56

So the matrix is (14282856)\begin{pmatrix} 14 & 28 \\ 28 & 56 \end{pmatrix}. Its Determinant is 14×56−28×28=784−784=014 \times 56 - 28 \times 28 = 784 - 784 = 0. A matrix with determinant zero has no inverse, which is the exact version of "the data cannot separate the two effects". Nearly collinear data gives a determinant close to zero, not exactly zero.

Step 2 in symbols: how much each coefficient wobbles

If the errors have variance σ2\sigma^2, the variance of the jj-th coefficient is

Var⁡(b^j)=σ2[(X⊤X)−1]jj\operatorname{Var}(\hat{b}_j) = \sigma^2 \left[(X^\top X)^{-1}\right]_{jj}

When X⊤XX^\top X is nearly singular, its inverse has very large diagonal entries, so the variance is large. A large variance means a large standard error.

Step 3 in symbols: the variance inflation factor

To measure this for one predictor, regress xjx_j on all the other predictors and record the R2R^2 of that regression, written Rj2R_j^2. The variance inflation factor is

VIFj=11−Rj2\text{VIF}_j = \frac{1}{1 - R_j^2}

If xjx_j is unrelated to the others, Rj2=0R_j^2 = 0 and VIFj=1\text{VIF}_j = 1. If xjx_j is almost a linear function of the others, Rj2R_j^2 is near 1 and the VIF is large. The variance of b^j\hat{b}_j is the variance it would have with no correlation, multiplied by VIFj\text{VIF}_j.

Worked examples

Example
1. Two predictors that are exact multiples

Use the tiny data set above, where x2=2x1x_2 = 2x_1.

  1. Regress x2x_2 on x1x_1. Since x2x_2 is exactly 2x12x_1, the fit is perfect.
  2. So R22=1R_2^2 = 1.
  3. The VIF is 1/(1−1)=1/01 / (1 - 1) = 1 / 0, which is infinite.
  4. The determinant of X⊤XX^\top X was zero in the walkthrough, so no unique solution exists.

Interpretation: when one predictor is an exact multiple of another, the model cannot say which of the two has the effect. Statistical software usually drops one of them or reports an error for this reason.

Example
2. Two predictors that nearly agree

Let x1=1,2,3,4x_1 = 1, 2, 3, 4 and x2=1.1,1.9,3.2,3.8x_2 = 1.1, 1.9, 3.2, 3.8. Both have mean 2.5.

  1. Deviations from the mean: x1x_1 gives −1.5,−0.5,0.5,1.5-1.5, -0.5, 0.5, 1.5. x2x_2 gives −1.4,−0.6,0.7,1.3-1.4, -0.6, 0.7, 1.3.
  2. Cross product: S12=(−1.5)(−1.4)+(−0.5)(−0.6)+(0.5)(0.7)+(1.5)(1.3)=2.1+0.3+0.35+1.95=4.7S_{12} = (-1.5)(-1.4) + (-0.5)(-0.6) + (0.5)(0.7) + (1.5)(1.3) = 2.1 + 0.3 + 0.35 + 1.95 = 4.7.
  3. Sums of squares: S11=5S_{11} = 5 and S22=4.5S_{22} = 4.5.
  4. The R2R^2 of regressing x2x_2 on x1x_1 is S122/(S11S22)=22.09/22.5≈0.982S_{12}^2 / (S_{11} S_{22}) = 22.09 / 22.5 \approx 0.982.
  5. The VIF is 1/(1−0.982)≈1/0.018≈551 / (1 - 0.982) \approx 1 / 0.018 \approx 55.

Interpretation: the standard error of each coefficient is inflated by the square root of about 55, which is roughly 7.4 times larger than it would be with uncorrelated predictors. The two predictors look different on paper, but this data cannot tell their effects apart.

Example
3. House size and number of rooms

This example is illustrative. A model of house price has floor area and number of rooms as predictors. Regressing rooms on the other predictors gives R2=0.8R^2 = 0.8, so VIF=1/(1−0.8)=5\text{VIF} = 1 / (1 - 0.8) = 5.

  1. The variance of the rooms coefficient is 5 times what it would be with uncorrelated predictors.
  2. The standard error is multiplied by 5≈2.24\sqrt{5} \approx 2.24.
  3. If the rooms coefficient would have had a standard error of 1,000 units of price, it now has about 2,236.
  4. Compare this with a confidence interval: an estimate that looks clearly positive can become indistinguishable from zero.

Interpretation: the price of an extra room is still estimated, but the estimate is far less precise. Predictions for typical houses are fine; claims about the exact price of one room are weak.

Try it: in a model with predictors x1x_1 and x2x_2, regressing x2x_2 on x1x_1 gives R2=0.96R^2 = 0.96. What is the VIF for x2x_2, and by what factor is its standard error multiplied?

Answer: VIF=1/(1−0.96)=1/0.04=25\text{VIF} = 1 / (1 - 0.96) = 1 / 0.04 = 25. The standard error is multiplied by 25=5\sqrt{25} = 5.

Common mistakes and tradeoffs

It is tempting to think multicollinearity makes the model wrong. In fact the predictions can be accurate, because the combined effect of the correlated predictors is still well determined. The damage is to the separate coefficients and their significance tests.

It is tempting to think high correlation always breaks a regression. In fact the problem depends on the question. If you only want to predict, correlated predictors are often harmless. If you want the effect of one predictor with the others held fixed, it matters a lot.

It is tempting to think a VIF above 10 is a strict cutoff. In fact 10 is a rough rule of thumb from practice, not a law. What matters is whether the inflated standard errors are big enough to change your conclusions.

It is tempting to think that dropping one of the correlated predictors is always the fix. In fact it can remove the problem but also bias the remaining coefficient, since it now absorbs the effect of the dropped variable. Dropping is a choice about what question the model answers.

When to act: when you need stable individual coefficients and some of the VIFs are large, and the predictors have a clear meaning you can justify keeping or dropping.

When it matters less: when the model is for prediction only, or when the correlation is weak.

Alternatives: combine correlated predictors into one (for example, an index or the first principal component), collect more varied data, or use ridge regression, which adds a penalty that stabilises the inverse of X⊤XX^\top X at the cost of some bias.

History

The problem was studied long before it had a name. Early in the twentieth century, economists and statisticians fitting several regressors to time series found coefficients that changed wildly with small changes in the data. The Norwegian economist Ragnar Frisch, in work from the early 1930s, used the term "multicollinearity" for the situation of near-linear relations among predictors. Later statisticians developed diagnostics, such as the VIF, to measure it, and ridge regression, proposed in the 1970s, gave a standard remedy.

Recap

  • Multicollinearity is when predictors in a regression carry nearly the same information.
  • It makes X⊤XX^\top X nearly singular, so the coefficients are poorly determined.
  • The variance of each coefficient is inflated by VIFj=1/(1−Rj2)\text{VIF}_j = 1 / (1 - R_j^2).
  • Predictions can still be good; individual effects and their tests are what suffer.
  • Remedies include dropping or combining predictors, collecting more varied data, and ridge regression.

Read next: penalized least squares, which shows one way to stabilise the solution when the predictors are correlated.

Check yourself

QuestionRecall: what does it mean for the matrix X⊤XX^\top X to be nearly singular, and why does that matter for regression?Show answer

It means its determinant is close to zero, so its inverse is very large in some directions. The least squares solution depends on that inverse, so the coefficients become unstable: small changes in the data can move them a lot, and their standard errors grow.

QuestionA predictor has R2=0.9R^2 = 0.9 when regressed on the other predictors. What is its VIF, and by what factor is its standard error multiplied?Show answer

VIF=1/(1−0.9)=10\text{VIF} = 1 / (1 - 0.9) = 10. The standard error is multiplied by 10≈3.16\sqrt{10} \approx 3.16.

QuestionWhy can a model with strongly correlated predictors still predict new data well?Show answer

Because the data constrains the combined effect of the correlated predictors even when it cannot split that effect between them. Predictions depend on the combination, so they can remain accurate while the individual coefficients stay uncertain.

QuestionA researcher drops one of two correlated predictors to fix the problem. Explain the risk of this choice in a scenario where both predictors affect the outcome.Show answer

The remaining predictor now picks up part of the effect of the dropped one, because they are correlated. Its coefficient becomes biased, so it no longer measures the effect it was meant to measure, even though its standard error is smaller.

Sources