<p>Find $\hat{\beta_2}$:</p>

<p>$$\hat{\beta_2}=\frac{\Sigma(Y_i-\bar{Y})(MALE - \overline{MALE})}{\Sigma(MALE - \overline{MALE})^2}$$</p>

<p>Assuming m males in a sample of n people, $$\overline{MALE}=\frac{m}{n}$$</p>

<p>We can say:</p>

<p>$$MALE - \overline{MALE}=\begin{cases}-\frac{m}{n} &amp; \text{if }MALE=0\\\\\frac{n-m}{n} &amp; \text{if }MALE=1\end{cases}$$</p>

<p>With some algebra, the numerator of $\hat{\beta_2}$ becomes:</p>

<p>$$\Sigma(Y_i-\bar{Y})(MALE - \overline{MALE})=\frac{m(n - m)}{n}(\bar{Y_M} - \bar{Y_F})$$</p>

<p>The numerator of $\hat{\beta_2}$ becomes:</p>

<p>$$\Sigma(MALE - \overline{MALE})^2=\frac{m(n - m)^2 + m^2(n - m)}{n^2}=\frac{m(n - m)}{n}$$</p>

<p>Dividing the two gives the correct answer:</p>

<p>$$\hat{\beta_2}=\bar{Y_M} - \bar{Y_F}$$</p>

<p>Find $\hat{\beta_1}$:</p>

<p>$$\hat{\beta_1}=\bar{Y}-\hat{\beta_2}\overline{MALE}=\frac{m\bar{Y_M}+(n - m)\bar{Y_F}}{n} - (\bar{Y_M} - \bar{Y_F})\frac{m}{n}=\bar{Y_F}$$</p>

CC BY-SA 4.0
2018-06-06T12:01:54.517Z
2018-06-06T12:01:54.517Z
StevenRJClarke1985
<p>Consider a simple linear model:</p>

<p>$Y = \beta_1 + \beta_2 MALE + u$</p>

<p>where $MALE$ is a dummy variable. $MALE = 0$ if female, $MALE = 1$ if male.</p>

<p>A model is fitted:</p>

<p>$\hat{Y} = \hat{\beta_1} + \hat{\beta_2} MALE$</p>

<p>$\bar{Y_F}$ and $\bar{Y_M}$ are the sample means of $Y$ for females and males respectively.</p>

<p>Prove that:</p>

<p>$\hat{\beta_1} = \bar{Y_F}$, $\hat{\beta_2} = \bar{Y_M} - \bar{Y_F}$</p>

<p>If the points are plotted in a scatter block, there will be two vertical clusters of points at $MALE = 0$ and $MALE = 1$, as shown:</p>

<p><a href="https://i.sstatic.net/AlHWj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AlHWj.png" alt="Scatter plot and regression line"></a></p>

<p>It seems intuitively obvious that the total residual sum of squares ($RSS$) is minimized by minimizing the $RSS$ separately for the female and male points. This is achieved by fitting a point at the mean of these points, $\bar{Y_F}$ and $\bar{Y_M}$. Fitting a line between these point yields the correct values for $\hat{\beta_1}$ and $\hat{\beta_2}$.</p>

<p>I wish to prove this algebraically.</p>

CC BY-SA 4.0
2018-06-06T09:42:41.327Z
This is not a place to get homeworks done. If you provide your solution (or at least a try) and explain your doubts, you can get help
PostDocing
CC BY-SA 4.0
2018-06-06T12:02:36.510Z
@Alessandro Thank you for your comment. I have gone away and attempted the question again. My answer is as below.
StevenRJClarke1985
<econometrics><mathematical-economics>
Simple Regression With Dummy Variable
StevenRJClarke1985
# Simple Regression With Dummy Variable

(Asked by: username_0 on 2018-06-05)

Consider a simple linear model:

$Y = \beta\_1 + \beta\_2 MALE + u$

where $MALE$ is a dummy variable. $MALE = 0$ if female, $MALE = 1$ if male.

A model is fitted:

$\hat{Y} = \hat{\beta\_1} + \hat{\beta\_2} MALE$

$\bar{Y\_F}$ and $\bar{Y\_M}$ are the sample means of $Y$ for females and males respectively.

Prove that:

$\hat{\beta\_1} = \bar{Y\_F}$, $\hat{\beta\_2} = \bar{Y\_M} - \bar{Y\_F}$

If the points are plotted in a scatter block, there will be two vertical clusters of points at $MALE = 0$ and $MALE = 1$, as shown:

[![Scatter plot and regression line](https://i.sstatic.net/AlHWj.png)](https://i.sstatic.net/AlHWj.png)

It seems intuitively obvious that the total residual sum of squares ($RSS$) is minimized by minimizing the $RSS$ separately for the female and male points. This is achieved by fitting a point at the mean of these points, $\bar{Y\_F}$ and $\bar{Y\_M}$. Fitting a line between these point yields the correct values for $\hat{\beta\_1}$ and $\hat{\beta\_2}$.

I wish to prove this algebraically.

**Tags:** econometrics, mathematical-economics
> **Comments:**
> **username_1**: This is not a place to get homeworks done. If you provide your solution (or at least a try) and explain your doubts, you can get help  
> **username_0**: @Alessandro Thank you for your comment. I have gone away and attempted the question again. My answer is as below.  

---

## 1 answers

### Answer by username_0 on 2018-06-06. Score: 0 | Accepted answer

Find $\hat{\beta\_2}$:

$$\hat{\beta\_2}=\frac{\Sigma(Y\_i-\bar{Y})(MALE - \overline{MALE})}{\Sigma(MALE - \overline{MALE})^2}$$

Assuming m males in a sample of n people, $$\overline{MALE}=\frac{m}{n}$$

We can say:

$$MALE - \overline{MALE}=\begin{cases}-\frac{m}{n} & \text{if }MALE=0\\\\\frac{n-m}{n} & \text{if }MALE=1\end{cases}$$

With some algebra, the numerator of $\hat{\beta\_2}$ becomes:

$$\Sigma(Y\_i-\bar{Y})(MALE - \overline{MALE})=\frac{m(n - m)}{n}(\bar{Y\_M} - \bar{Y\_F})$$

The numerator of $\hat{\beta\_2}$ becomes:

$$\Sigma(MALE - \overline{MALE})^2=\frac{m(n - m)^2 + m^2(n - m)}{n^2}=\frac{m(n - m)}{n}$$

Dividing the two gives the correct answer:

$$\hat{\beta\_2}=\bar{Y\_M} - \bar{Y\_F}$$

Find $\hat{\beta\_1}$:

$$\hat{\beta\_1}=\bar{Y}-\hat{\beta\_2}\overline{MALE}=\frac{m\bar{Y\_M}+(n - m)\bar{Y\_F}}{n} - (\bar{Y\_M} - \bar{Y\_F})\frac{m}{n}=\bar{Y\_F}$$


---

