# Multiple linear regression with multicollinearity: residual regression

I am trying to build a multiple linear regression with predictor variables that likely are correlated. I understand that this is a problem, due to overlapping explanations of data. I think I have a method that may get around this, but would like to see if it is valid.

The idea, simply put, is to do the following:

1. Perform a linear regression and find the residuals $$\hat{y_1}=m_1\hat{x_1}+b_1$$ $$r_1=y_1-\hat{y_1}$$
2. Calculate a least squares regression between the residual of the prior regression and the next predictor variable. For example, $$\hat{r_1}=m_2\hat{x_2}+b_2$$ $$r_2=r_1-\hat{r_1}$$
3. Repeat the idea behind step 2 for $$M$$ variables. This can be written as $$\hat{r}_{i-1}=m_i\hat{x}_i+b_i$$ $$r_i=r_{i-1}-\hat{r}_{i-1}$$
The idea behind this is that the multiple linear regression could be written as $$\hat{y}_{MLR}=\sum\limits_{j=1}^M m_j\hat{x}_j+b_j$$

My questions behind this is:

1. Will it work?
2. Does it truly bypass the problem of multicollinearity?
3. Is there any unforeseen problems with this that are being overlooked?

I understand that this is a problem, due to overlapping explanations of data.

It depends on what is your ultimate goal of the regression.

• If you want inference, multicollinearity is problematic.
• But if you want prediction accuracy, there is no problem of overlapping explaination of data as long as the correlation between the predictors doesn't change. The problem from the correlated predictors is more on the side of expected test error (MSE), which can be decomposed into three components:

$$E [y_0 - \hat{y_0}]^2 = Var(\hat{y_0}) + [Bias(y_0)]^2 + Var(\epsilon)$$

1. Bias level of the estimates
2. Variance of them
3. Irreducable error $Var(\epsilon)$

When there are two strongly correlated predictors in the data base, the matrix $X^T X$ has a determinant closed to zero, wheares, the variance of the estimated value, under homoskedasticity, is $\hat{\sigma}^2 (X^T X)^{-1}$. So, if the determinant gets close to zero, the variance gets uncomfortably big, the expected test errror gets big too. And it is not good.

1. Will it work? Yes, all models are true, but lots of them are useless. (see question 3)
2. Does it truly bypass the problem of multicollinearity? It will bypass the multicollinearity problem in one sense but there will be other problems with this approach.
3. Is there any unforeseen problems with this that are being overlooked? Yes, when you fit one variable each time, it's like one-way analysis, all the estimated coefficient will be highly biased. Furthermore, this aproach neglect the multi-variable effect, for example one variable that is not significant can become useful for the model when including together with other variables.

Let's take a simple example in which I simulated two independent random variables $X_1$ and $X_2$, and my response variable is $Y$ such that the true relationship is:

$$Y=1+2*X_1 + 7*X_2 + \epsilon$$

set.seed(3)
x1 = runif(100,0,100)
x2 = runif(100,0,100)
epsi = rnorm(100)
y = 1+2*x1 + 7*x2 + epsi

dat=data.frame(y,x1,x2,epsi)


Processing as in the "residual regression" way:

mod1 = lm(y~x1,data=dat)
summary(mod1)


Results:

   Call:
lm(formula = y ~ x1, data = dat)

Residuals:
Min     1Q Median     3Q    Max
-333.5 -138.0  -14.4  176.1  354.0

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 371.8279    36.8386  10.093   <2e-16 ***
x1            1.3336     0.6558   2.033   0.0447 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 186.9 on 98 degrees of freedom
Multiple R-squared:  0.04048,   Adjusted R-squared:  0.03069
F-statistic: 4.135 on 1 and 98 DF,  p-value: 0.04471


Not talking about the intercept, the estimated coefficient associated with the variable $X_1$ is 1.3 wheares it should have been 2. This coefficient stays unchanged when you fit the residuals of this first model on the variable $X_2$. Why is the intercept so large, and why is the $\beta_1$ biased? This is to compensate the absence of $x_2$ in the model. And if we take the plot of $Y$ against $X_1$, it can be observed that the trend of $X_1$ can not be easily seen because of the large influence of $X_2$

And if we fit $Y$ on $X_1$ and $X_2$ together, all the estimated value gets the value that we expect, i.e $\beta_0 =1$, $\beta_1 =2$ , $\beta_3 =7$

> mod2 = lm(y~x1+x2,data=dat)
> summary(mod2)

Call:
lm(formula = y ~ x1 + x2, data = dat)

Residuals:
Min       1Q   Median       3Q      Max
-2.37635 -0.80796  0.09194  0.69199  2.64910

Coefficients:
Estimate Std. Error  t value Pr(>|t|)
(Intercept) 0.942346   0.311126    3.029  0.00315 **
x1          2.002710   0.003904  512.988  < 2e-16 ***
x2          6.998871   0.004186 1671.797  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.106 on 97 degrees of freedom
Multiple R-squared:      1, Adjusted R-squared:      1
F-statistic: 1.456e+06 on 2 and 97 DF,  p-value: < 2.2e-16