Let the sample regression line be
$$
y_i=b_0+b_1 x_i+e_i=y_i+e_i(i=1,2, \ldots, n)
$$
and let $\bar{x}$ and $\bar{y}$ denote the sample means for the independent and dependent variables, respectively.
a. Show that
$$
c_i=y_i-\bar{y}-b\left(x_i-\bar{x}\right)
$$
b. Using the result in part $a$, show that
$$
\sum_{i=1}^n e_i=0
$$
c. Using the result in part $\mathrm{a}$, show that
$$
\sum_{i=1}^n e_i^2=\sum_{i=1}^n\left(y_i-\bar{y}\right)^2-b^2 \sum_{i=1}^n\left(x_i-\bar{x}\right)^2
$$
d. Show that
$$
\hat{y}_i-\bar{y}=b_i\left(x_i-\bar{x}\right)
$$
e. Using the results in parts $\mathrm{c}$ and $d$, show that
$$
S S T=S S R+S S E
$$
f. Using the result in part $a$, show that
$$
\sum_{i=1}^n e_i\left(x_i-\bar{x}\right)=0
$$