1

I am looking to find out how the derivation went in this computation

$$ \frac{1}{n-1} \sum (x_i - \bar{x})^2 = \frac{1}{n-1} \left( \sum x_i^2 - n\bar{x}^2 \right) $$

The exercise belongs to sample distribution section but that's not what bothers me. As you can see there's a square notation inside a summation notation. Now I would take square of sum's here as in $(a-b)^2 = a^2 - 2ab + b^2$ . Yet the result in the picture seems to ommit $2ab$ or probably say simplify. My question is how does he get to such a derivation. Is there any sort of special formula or some point that I am severely missing :/ ?

1 Answers1

3

I expect that this question has been answered on MSE before, but I cannot find a [duplicate] target. As my students often are confused by this point, it seems like it should have an answer on MSE, so here's one:

Recall that the sample mean $\bar{x}$ of a collection of data $\{x_i\}_{i=1}^{n}$ is given by $$\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i. $$ But then \begin{align} \sum_{i=1}^{n} (x_i - \bar{x})^2 &= \sum_{i=1}^{n} (x_i^2 - 2x_i\bar{x} + \bar{x}^2) \\ &= \sum_{i=1}^{n} (x_i^2) - 2\bar{x}\underbrace{\sum_{i=1}^{n} x_i}_{\normalsize= n\bar{x}} + \underbrace{\sum_{i=1}^{n} \bar{x}^2}_{\normalsize=n\bar{x}^2} \\ &= \sum_{i=1}^{n} (x_i^2) - 2n\bar{x}^2 + n\bar{x}^2 \\ &= \sum_{i=1}^{n} (x_i)^2 - n\bar{x}^2. \end{align} Multiplying both sides of this identity by $\frac{1}{n-1}$, we obtain the original formula.