OLS Estimation
Suppose we have the following data on a dependent variable (\(Y\)) and an independent variable (\(X\)):
We wish to estimate the simple linear regression model:
\[
Y_i = \beta_0 + \beta_1X_i + u_i
\]
Calculate the OLS estimates \(\hat{\beta}_0\) and \(\hat{\beta}_1\). Show your work.
Hint: Recall the forumlas for the OLS estimates:
\[
\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1\bar{X}
\]
\[
\hat{\beta}_1 = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{\sum (X_i - \bar{X})^2}
\]
where \(\bar{X}\) and \(\bar{Y}\) are the sample means of \(X\) and \(Y\), respectively.
To calculate the OLS estimates, we need to compute the slope \(\hat{\beta}_1\) and the intercept \(\hat{\beta}_0\).
The slope \(\hat{\beta}_1\) is given by the formula:
\[
\hat{\beta}_1 = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{\sum (X_i - \bar{X})^2}
\]
And the intercept \(\hat{\beta}_0\) is given by:
\[
\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1\bar{X}
\]
Given the data:
- \(\bar{X} = \frac{2 + 4 + 6}{3} = 4\)
- \(\bar{Y} = \frac{10 + 20 + 30}{3} = 20\)
The slope \(\hat{\beta}_1\):
- \(\hat{\beta}_1 = \frac{(2-4)(10-20) + (4-4)(20-20) + (6-4)(30-20)}{(2-4)^2 + (4-4)^2 + (6-4)^2}\)
- \(\hat{\beta}_1 = \frac{(-2)(-10) + (0)(0) + (2)(10)}{(-2)^2 + (0)^2 + (2)^2}\)
- \(\hat{\beta}_1 = \frac{20 + 0 + 20}{4 + 0 + 4}\)
- \(\hat{\beta}_1 = \frac{40}{8}\)
- \(\hat{\beta}_1 = 5\)
The intercept \(\hat{\beta}_0\):
- \(\hat{\beta}_0 = 20 - 5 \cdot 4\)
- \(\hat{\beta}_0 = 20 - 20\)
- \(\hat{\beta}_0 = 0\)
So the estimated regression line is:
\[
Y = 0 + 5X
\]