Everyone is welcome here (except, of course, those who have borrowed books from me for and have not returned them yet 😉)

"Correlated regressors in multiple regression"

Posted on mars 31, 2014 in misc

It is often asserted that when one two (or more) independent variables are correlated, this creates a problem in multiple linear regression. What problem? And when is it really serious?

In multiple regression, the coefficient estimated for each regressor represents the influence of this regressor when the others predictors are kept constant. Thus it is the “unique” contribution of this variable.

More precisely because the equation is linear:

\(y_{pred} = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots\)

\(\beta_i\) represents the change in \(y_pred\) when \(x_i\) increases by one unit while the other \(x_j\) remain constant.

When \(x_i\) is orthogonal to all the other predictors, the value of \(\beta_i\) is insensitive to the presence or absence of these predictors in the linear models (assuming that the Ordinary Least Square method is used to estimate the \(\beta\)s). It can still be of interest to include the other predictors in the model if one wants to predict \(y\) or explain out part of the residuals.

If \(x_i\) is not orthogonal to the \(x_j\), \(j \neq i\), then it means that \(x_i\) naturally covaries with them. Then, the meaning of a variation in \(x_i\) when the other are kept constant must be inspected carefully. Take height and weights of humans. An effect of height independant in weight means, for example, that you are going to compare thin tall people with large small ones. This can be interesting, or not. What is crucial is that you are must be able to interpret the coefficients. Sometimes, “all other things being equal” is a pie in the sky.

Now, from a mathematical perspective, unless the predictors are perfectly, or nealry, correlated (the matrix is ill-conditionned), the \(\beta_i\) can be computed without problem.

The issues are: - the standard error of these estimates is inflated when correlations becomes high (see the simulations below) - they may be quasi meaningless, especially for predictors that are measured with error.

Let me show an example of the

set.seed(0)
x1 = c(1, 0.9, 0, 0)
x2 = c(0.9, 1, 0, 0)
y = - 3 * x1 + 5 * x2 + rnorm(2, sd=.5)
summary(lm(y ~ x1))
summary(lm(y ~ x2))
summary(lm(y~ x1 + x2))
```gucv
## Error: attempt to use zero-length variable name
require(mvtnorm)
## Loading required package: mvtnorm
require(car)
## Loading required package: car
## Loading required package: carData
n <- 100
a1 <- 0.2
a2 <- 0.3
nsim <- 100

for (cor in c(0, .2, .4, .6, .8))
  {
  d <- rmvnorm(n, sigma=matrix(c(1, cor, cor, 1), nrow=2))
  x1 <- d[,1]
  x2 <- d[,2]
  print(cor.test(x1, x2))
  print("VIF:")
  print(vif(lm(rnorm(n)~x1 + x2)))

  stats <- matrix(NA, nrow=nsim, ncol=4)
  for (i in 1:nsim)
    {
    y <- a1 * x1 + a2 * x2 + rnorm(n)
    lmmod <-lm(y ~ x1 + x2)
    slm <- summary(lmmod)

    stats[i,] <- as.numeric(slm$coefficients[2:3, 1:2])
    }
  boxplot(stats, main=cor, ylim=c(-0.2,0.6))
  print(apply(stats, 2, summary))
}
## 
##  Pearson's product-moment correlation
## 
## data:  x1 and x2
## t = -0.047598, df = 98, p-value = 0.9621
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2010363  0.1917912
## sample estimates:
##          cor 
## -0.004808085 
## 
## [1] "VIF:"
##       x1       x2 
## 1.000023 1.000023

plot of chunk unnamed-chunk-2

##                [,1]        [,2]       [,3]       [,4]
## Min.    -0.02893058 -0.03186585 0.07298104 0.08379504
## 1st Qu.  0.13301786  0.24791570 0.08838659 0.10148332
## Median   0.19013759  0.32366597 0.09271697 0.10645536
## Mean     0.19460297  0.32134727 0.09231430 0.10599302
## 3rd Qu.  0.25075050  0.40413171 0.09775844 0.11224385
## Max.     0.46215022  0.55199893 0.10719749 0.12308154
## 
##  Pearson's product-moment correlation
## 
## data:  x1 and x2
## t = 2.9502, df = 98, p-value = 0.003972
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.09448359 0.45641585
## sample estimates:
##       cor 
## 0.2856014 
## 
## [1] "VIF:"
##       x1       x2 
## 1.088812 1.088812

plot of chunk unnamed-chunk-2

##                [,1]      [,2]       [,3]       [,4]
## Min.    -0.08897539 0.1130144 0.08205714 0.07942190
## 1st Qu.  0.13823990 0.2300391 0.09707947 0.09396180
## Median   0.19316651 0.3087067 0.10152671 0.09826621
## Mean     0.19724232 0.3115949 0.10166282 0.09839795
## 3rd Qu.  0.25977745 0.3757634 0.10674256 0.10331456
## Max.     0.42059596 0.6193702 0.11779210 0.11400924
## 
##  Pearson's product-moment correlation
## 
## data:  x1 and x2
## t = 3.9681, df = 98, p-value = 0.0001381
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1894915 0.5297647
## sample estimates:
##       cor 
## 0.3720616 
## 
## [1] "VIF:"
##       x1       x2 
## 1.160672 1.160672

plot of chunk unnamed-chunk-2

##                [,1]       [,2]       [,3]       [,4]
## Min.    -0.05069179 0.01854132 0.08518082 0.08460567
## 1st Qu.  0.13305933 0.21105394 0.10345929 0.10276071
## Median   0.21293574 0.27441392 0.10785275 0.10712451
## Mean     0.20603365 0.27843301 0.10805202 0.10732243
## 3rd Qu.  0.27950655 0.34626807 0.11382016 0.11305162
## Max.     0.42872453 0.51765619 0.12667559 0.12582025
## 
##  Pearson's product-moment correlation
## 
## data:  x1 and x2
## t = 9.871, df = 98, p-value = 2.306e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.5917378 0.7925843
## sample estimates:
##       cor 
## 0.7060886 
## 
## [1] "VIF:"
##       x1       x2 
## 1.994261 1.994261

plot of chunk unnamed-chunk-2

##               [,1]        [,2]      [,3]      [,4]
## Min.    -0.1104012 -0.05480868 0.1086390 0.1132833
## 1st Qu.  0.1069787  0.19789372 0.1247570 0.1300903
## Median   0.2098592  0.29524331 0.1310119 0.1366127
## Mean     0.1905557  0.29699883 0.1303029 0.1358733
## 3rd Qu.  0.2901654  0.37138752 0.1363372 0.1421656
## Max.     0.4665957  0.56605734 0.1595834 0.1664056
## 
##  Pearson's product-moment correlation
## 
## data:  x1 and x2
## t = 12.663, df = 98, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.6996717 0.8523453
## sample estimates:
##      cor 
## 0.787821 
## 
## [1] "VIF:"
##       x1       x2 
## 2.636171 2.636171

plot of chunk unnamed-chunk-2

##                [,1]        [,2]      [,3]      [,4]
## Min.    -0.29605138 -0.02948919 0.1452438 0.1417825
## 1st Qu.  0.06270983  0.19798470 0.1672007 0.1632162
## Median   0.20129157  0.30343428 0.1739810 0.1698348
## Mean     0.20865386  0.30439338 0.1747157 0.1705520
## 3rd Qu.  0.35111188  0.40992756 0.1824928 0.1781438
## Max.     0.64936984  0.81626085 0.2062827 0.2013668