Can someone help me understand the following for the variance of a sample proportion.
$$ S^2 = \dfrac{\sum (y_i - p)^2}{N-1} = \dfrac{\sum y_i^2 - 2p\sum yi + Np^2 }{N-1} = \dfrac{N}{N-1}p(1-p) $$
More specifically how do you get to the last step from the second last step.
Thanks!