I am reading through the book An introduction to Statistical learning with Applications in R
, and get stuck:
When doing linear regression, we can write the relation as
$$Y = \beta_0 + \beta_1X + \epsilon$$
where $$E(\epsilon)=0$$
And, we can define the residual sum of squares (RSS) as $$RSS = e_1^2 + e_2^2 + ... +e_n^2$$ where $e_i = y_i-\hat{y_i}$
To minimize the RSS, we can get
$$\hat{\beta_1} = \frac{\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})}{\sum_{i=1}^{n}(x_i-\bar{x})^2}$$ $$\hat{\beta_0} = \bar{y}-\hat{\beta_1}\bar{x}$$
But, I cannot get the standard error with $\hat{\beta_0}$, which is (as the book says but I do not know how to prove it)
$$SE(\hat{\beta_0})^2 = var(\epsilon)[\frac{1}{n} + \frac{\bar{x}^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}]$$ $$SE(\hat{\beta_1})^2 = \frac{var(\epsilon)}{\sum_{i=1}^{n}(x_i - \bar{x})^2}$$
How to prove $SE(\hat{\beta_0})^2$ and $SE(\hat{\beta_1})^2$?