<p>You are not replacing <span class="math-container">$y$</span> with <span class="math-container">$e$</span>. We are replacing <span class="math-container">$y$</span> with <span class="math-container">$\hat{y}+\hat{e}$</span>, which is the fitted value of <span class="math-container">$y$</span>, given by <span class="math-container">$X\hat{\beta}$</span>, plus the estimated value of the residual, given by <span class="math-container">$y-X\hat{\beta}$</span>. So, by construction, <span class="math-container">$$X\hat{\beta}+\hat{e}=X\hat{\beta}+y-X\hat{\beta}=y$$</span>.</p>

CC BY-SA 4.0
2019-03-10T07:05:17.687Z
2019-03-10T07:05:17.687Z
user21356
<p><span class="math-container">$$\big[ I-W(W'W)^{-1}W'+WC\big]y = \big[ I-W(W'W)^{-1}W'+WC\big](W\beta + e)$$</span></p>

<p><span class="math-container">$$=\big[ I-W(W'W)^{-1}W'+WC\big]W\beta + \big[ I-W(W'W)^{-1}W'+WC\big] e$$</span></p>

<p>Analyzing the first term,</p>

<p><span class="math-container">$$\big[ I-W(W'W)^{-1}W'+WC\big]W\beta = W\beta - W(W'W)^{-1}W'W\beta + WCW\beta$$</span></p>

<p>Simplyfying the inverse, we get </p>

<p><span class="math-container">$$...= WCW\beta$$</span></p>

<p>So <em>if</em> <span class="math-container">$$CW = 0$$</span></p>

<p>the whole first term is zero.</p>

CC BY-SA 4.0
2019-03-09T15:32:37.050Z
2019-03-09T15:32:37.050Z
Alecos Papadopoulos
<p>I don't understand why we can replace <code>y</code> with <code>e</code>:
<a href="https://i.sstatic.net/kt4rk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kt4rk.png" alt="proof"></a></p>

<p>Mainly, why can we simply replace y with e, given that y is defined as:
<a href="https://i.sstatic.net/kU7MH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kU7MH.png" alt="y definition"></a></p>

<p>Thanks in advance!</p>

<variance>
Why can we replace dependent variable y with the residuals e?
ReRed
# Why can we replace dependent variable y with the residuals e?

(Asked by: username_0 on 2019-03-09)

I don't understand why we can replace `y` with `e`:
[![proof](https://i.sstatic.net/kt4rk.png)](https://i.sstatic.net/kt4rk.png)

Mainly, why can we simply replace y with e, given that y is defined as:
[![y definition](https://i.sstatic.net/kU7MH.png)](https://i.sstatic.net/kU7MH.png)

Thanks in advance!

**Tags:** variance


---

## 2 answers

### Answer by username_1 on 2019-03-10. Score: 2

You are not replacing $y$ with $e$. We are replacing $y$ with $\hat{y}+\hat{e}$, which is the fitted value of $y$, given by $X\hat{\beta}$, plus the estimated value of the residual, given by $y-X\hat{\beta}$. So, by construction, $$X\hat{\beta}+\hat{e}=X\hat{\beta}+y-X\hat{\beta}=y$$.


---

### Answer by username_2 on 2019-03-09. Score: 1

$$\big[ I-W(W'W)^{-1}W'+WC\big]y = \big[ I-W(W'W)^{-1}W'+WC\big](W\beta + e)$$

$$=\big[ I-W(W'W)^{-1}W'+WC\big]W\beta + \big[ I-W(W'W)^{-1}W'+WC\big] e$$

Analyzing the first term,

$$\big[ I-W(W'W)^{-1}W'+WC\big]W\beta = W\beta - W(W'W)^{-1}W'W\beta + WCW\beta$$

Simplyfying the inverse, we get

$$...= WCW\beta$$

So *if* $$CW = 0$$

the whole first term is zero.


---

