Algebra and dummy variable

Problem

This problem is more difficult. Only do it if you have solved the other problems. However, it is a fun and instructive problem which will improve your econometrics skills.

Consider the model \(y_i=β_1+β_2d_i+ε_i\) where \(d_i\) is a dummy variable. Let \(A\) be the observations where \(i=0\) and \(B\) be the observations where \(i=1\) . Let   \({\bar{y}}_A\) be the sample average of y-data in group \(A\) and let   \({\bar{y}}_B\) be the sample average of y-data in group \(B\) . The excel sheet below gives an example.

In this example \({\bar{y}}_A=3\) and \({\bar{y}}_B=7\) . The OLS estimates are displayed in D4-E4. As you can see, \({\bar{y}}_A=b_1\) and \({\bar{y}}_B=b_1+b_2\) . Prove that this is no coincidence and that it must always hold (as long as you have at least one 0 and at least one 1).

Solution