I'm getting stuck halfway through this:
Show that $$\sum_{i=1}^n (y_i - \bar y_s)^2 = \sum_{i=1}^n (y_i)^2 - n\bar y_s^2$$
My skills with manipulating sums are quite rusty. I multiply the left side and distribute the sum to each part. I can see that the middle term needs to become $-2n\bar y_s^2$ in order to combine with the third term to make $-n\bar y_s^2$, but I can't quite get there.
Assuming that $\bar{y}_s$ is the average of all $y_i$, we can define $$a=\bar{y}_s=\frac1n\sum_{i=1}^ny_i$$
Hence, $$\begin{align}\sum_{i=1}^n(y_i-\bar{y}_s)^2&=\sum_{i=1}^n(y_i-a)^2\\ &=\sum_{i=1}^n(y_i^2-2ay_i+a^2)\\ &=\left(\sum_{i=1}^n y_i^2\right)-2a\underbrace{\left(\sum_{i=1}^n y_i\right)}_{na}+na^2\\ &=\left(\sum_{i=1}^n y_i^2\right)-2na^2+na^2\\ &=\left(\sum_{i=1}^n y_i^2\right)-na^2\\ &=\left(\sum_{i=1}^n y_i^2\right)-n\bar{y}_s^2\qquad \blacksquare\\ \end{align}$$
NB - Using $a$ to represent $\bar{y}_s$ simplifies the notation for the workings, such that $y$ only occurs in $y_i$ which is used only for summation, for ease of visual display.