# Proof for OLS Estimator is Identical to the Difference in Average Outcomes

In chapter 7 of Imbens and Rubin's (2015) book (referenchere), it shows that in a randomized experiment (without covariates) and given a regression function $Y^{obs}_{i}=\alpha+\tau W_{i}+\epsilon_{i}$, the OLS estimator of the treatment effect is:

$\hat\tau^{ols}=\dfrac{\sum^{N}_{i=1}(W_{i}-\bar{W})(Y^{obs}_{i}-\bar{Y}^{obs})}{\sum^{N}_{i=1}(W_{i}-\bar{W})^{2}}$

where

$\bar{Y}^{obs}=\dfrac{1}{N}\sum^{N}_{i=1}Y^{obs}_{i}$ and $\bar{W}=\dfrac{1}{N}\sum^{N}_{i=1}W_{i}=\dfrac{N_{t}}{N}$

Finally, it says through "simple algebra" we can derive that

$\hat{\tau}^{ols}=\bar{Y}^{obs}_{t}-\bar{Y}^{obs}_{c}=\hat{\tau}^{dif}$

and it defines that $\bar{Y}^{obs}_{t}=\sum_{i:W_{i}=1}\dfrac{Y^{obs}_{i}}{N_{t}}$ and $\bar{Y}^{obs}_{c}=\sum_{i:W_{i}=0}\dfrac{Y^{obs}_{i}}{N_{c}}$

I have tried some ways but still fail to algebraically derive that $\hat{\tau}^{ols}=\bar{Y}^{obs}_{t}-\bar{Y}^{obs}_{c}$. Can anyone help? Thanks so much.

## 1. Direct Expansion

$\sum^{N}_{i=1}(W_{i}-\bar{W})(Y^{obs}_{i}-\bar{Y}^{obs})=\sum^{N}_{i=1}(W_{i}Y_{i}-W_{i}\bar{Y}-\bar{W}Y_{i}+\bar{W}{Y})=\sum^{N_{t}}W_{i}Y_{i}(1)+\sum^{N_{c}}(1-W_{i})Y_{i}(0)-N\bar{W}\bar{Y}$

$\sum^{N}_{i=1}(W_{i}-\bar{W})^{2}=\sum^{N}_{i=1}(W_{i}^{2}-2W_{i}\bar{W}+\bar{W}^{2})=\sum^{N}_{i=1}W_{i}^{2}-N\bar{W}^{2}=N_{t}-\dfrac{N_{t}^{2}}{N}$ (because $W_{i}^{2}=W_{i}$)

## 2. Let $D_{i}=W_{i}-\bar{W}$

$\hat\tau^{ols}=\dfrac{\sum^{N}_{i=1}D_{i}(Y^{obs}_{i}-\bar{Y}^{obs})}{\sum^{N}_{i=1}D_{i}^{2}}$

$\sum^{N}_{i=1}D_{i}(Y^{obs}_{i}-\bar{Y}^{obs})=\sum^{N}_{i=1}D_{i}Y^{obs}_{i}-\sum^{N}_{i=1}D_{i}\bar{Y}=\sum^{N_{t}}\dfrac{N_{c}}{N}W_{i}Y_{i}(1)+\sum^{N_{c}}\dfrac{-N_{t}}{N}(1-W_{i})Y_{i}(0)+\dfrac{\bar{Y}}{N}(N_{t}N_{c}-N_{t}N_{c})=\sum^{N_{t}}\dfrac{N_{c}}{N}W_{i}Y_{i}(1)+\sum^{N_{c}}\dfrac{-N_{t}}{N}(1-W_{i})Y_{i}(0)$

$\sum^{N}_{i=1}D_{i}^{2}=\dfrac{N_{t}N_{c}^{2}}{N^{2}}+\dfrac{N_{c}N_{t}^{2}}{N^{2}}$

I'll give you a guide on roughly how to go about it. But if you still struggle then you can read the solution below.

First, note that the numerator of $\hat{\tau}$ must be some factor of $\bar{Y}_t - \bar{Y}_c$ because there is no factor of $Y$ in the denominator. So expand the numerator into four sums and try and work it out as an expression that looks like $\lambda (\bar{Y}_t - \bar{Y}_c),$ where $\lambda$ is some expression without any $Y$s in it. Then it should follow that the denominator is also equal to $\lambda$, so those factors should cancel out. Find the denominator, similar to the numerator, by expanding out the terms into four separate sums and show that it is equal to the constant you're looking for.

## Solution

To evaluate the numerator of $\hat{\tau}$ note that, $$\sum_i W_i Y_i = N_t \bar{Y}_t,$$ $$-\sum_i W_i \bar{Y} = -N_t \bar{Y},$$ $$-\sum_i \bar{W} Y_i = -N_t \bar{Y},$$ $$\sum_i \bar{W} \bar{Y} = N_t \bar{Y}.$$

So the numerator of $\hat{\tau}$ is $N_t (\bar{Y}_t - \bar{Y}).$

Substituting $\bar{Y} = \frac{1}{N} (N_t \bar{Y}_t + N_c \bar{Y}_c)$ the numerator becomes $$(N_t - \frac{N_t^2}{N}) \bar{Y}_t - \frac{N_t N_c}{N} \bar{Y}_c.$$

Note that $\frac{N_t N_c}{N} = \frac{N_t (N - N_t)}{N} = N_t - \frac{N_t^2}{N}.$ So the numerator is, $$\left( N_t - \frac{N_t^2}{N} \right) \left( \bar{Y}_t - \bar{Y}_c \right).$$

Similarly, by expanding the denominator into four separate sums you can show that the denominator is $N_t - \frac{N_t^2}{N}.$

Therefore, $$\hat{\tau} = \bar{Y}_t - \bar{Y}_c.$$

• Thanks a lot! I also edit my question and put ways I have tried but didn't work out. – tzu Oct 13 '17 at 20:53