# Stats: proving an equality with summations

• Feb 2nd 2009, 10:41 AM
angel.white
Stats: proving an equality with summations
Spent several hours trying to prove this, and now my eyes are swimming :/

I need to show that: $ns^2_{n+1} = (n-1)s^2_n + \frac{n}{n+1}(x_{n+1} - \bar{x}_n)^2$

where $\bar{x}$ is the mean, and $s^2_n$ is the variance for a set of data with n elements, and $s^2_{n+1}$ is the variance for the same set of data, with 1 additional element ( $x_{n+1}$) added to it. The goal being, I assume, to calculate the new variance based on the old variance without having to redo the grunt work.

edit:
some formulas
$\bar{x} = \frac{\sum_{i=1}^n x_i}{n}$

$s^2 = \frac{\sum_{i=1}^n(x_i-\bar{x})^2}{n-1}$

or, alternatively

$s^2 = \frac{\sum_{i=1}^n x_i^2 - \frac{(\sum_{i=1}^n x_i)^2}{n}}{n-1}$

In a different portion of question, they also mentioned that the mean of the set with $x_{i+1}$ added to it can be derived from the current mean. I determined that this formula is $\bar{x}_{i+1} = \frac{n\bar{x}_n + x_{n+1}}{n+1}$