# Math Help - Standard deviation question

1. ## Standard deviation question

I have a mean and an SD from a set of 20 results but i do not have 20 seperate results. Is there a way I can calculate a new SD if I add one more result to the result set by using the previous Standard deviation?
Thanks
Michael

3. ## Re: Standard deviation question

Need to be careful here, since the mean of the population changes with the addition of the new data point. Starting with

$\sigma_n^2 = \frac 1 {(n-1)} \sum_{i=1}^n (x_i - \mu_n)^2$ it turns out that with the new data point:

$\sum_{i=1}^n (x_i - \mu_{n+1})^2 = \sum_{i=1}^n (x_i - \mu_{n})^2 + n(\mu_{n+1}-\mu_n)^2$

Hence $\sum_{i=1}^{n+1} (x_i - \mu_{n+1})^2 = \sum_{i=1}^n (x_i - \mu_{n})^2 + n(\mu_{n+1}-\mu_n)^2 + (x_{n+1} - \mu_{n+1})^2$

Now you can find the new standard deviation from $\sigma_{n+1}^2 = \frac 1 n \sum_{i=1}^{n+1} (x_i - \mu_n)^2$.

4. ## Re: Standard deviation question

Many thanks for the replies guys. If you could explain layman terms I would be ever so grateful, I really do not understand the symbols and what they mean. I'm a web developer who has been handed this task. I can work out SD easily from a result set but the above problem is above my level of understanding.

5. ## Re: Standard deviation question

Originally Posted by mickyc1
...If you could explain layman terms I would be ever so grateful...
OK:

Let $\sigma_1$ be the original standard deviation, $\mu_1$ be the original mean, and $N$ = the number of data points you started with (20 in your case). Let $x$ be the new data point that you are now going to include. You are interested in calculating the new standard deviation $\sigma_2$ and mean $\mu_2$. The calculation is:

1. $\mu_2 = \frac {N \mu_1 + x} {N+1}$

2. $\sigma_2 = \sqrt {\frac 1 {N} \left( (N-1)\sigma_1^2+ N(\mu_2 - \mu_1)^2 + (x-\mu_2)^2 \right)}$

Hope this helps.

6. ## Re: Standard deviation question

Absolutely fantastic ebaines, that is perfectly explained.

7. ## Re: Standard deviation question

Something must be wrong with my calculations! I have 22 results with a mean of 4.33 and an SD of of 0.327. A new result is added of 5. The SD I get from that is 1.05 but that looks totally wrong. Any ideas?

10. ## Re: Standard deviation question

Is there an error in ebaines formula?

If the standard deviation were calculated using $s^2=\frac{1}{n-1}\left(\Sigma x^2- \frac{1}{n}(\Sigma x)^2 \right)$ then if we are given
standard deviation =s
mean = m
sample size = n
and extra value = x

then I get

$\text{ new s }= s'=\sqrt{\frac{1}{n}\left((n-1)s^2+m^2n+x^2-\frac{1}{n+1}(mn+x)^2\right)}$

$\text{ new m }= m' = \frac{mn+x}{n+1}$

11. ## Re: Standard deviation question

Originally Posted by a tutor
Is there an error in ebaines formula?

If the standard deviation were calculated using $s^2=\frac{1}{n-1}\left(\Sigma x^2- \frac{1}{n}(\Sigma x)^2 \right)$ then if we are given
standard deviation =s
mean = m
sample size = n
and extra value = x

then I get

$\text{ new s }= s'=\sqrt{\frac{1}{n}\left((n-1)s^2+m^2n+x^2-\frac{1}{n+1}(mn+x)^2\right)}$

$\text{ new m }= m' = \frac{mn+x}{n+1}$
Using the values I defined above, could you show me how to apply your above formula?

12. ## Re: Standard deviation question

Sub everything in..

$\text{ new s }= s'=\sqrt{\frac{1}{22}\left((22-1)\times 0.327^2+4.33^2\times 22+5^2-\frac{1}{22+1}(4.33\times 22+5)^2\right)}$

and then calculate it. You should get 0.3486918155 which seems reasonable...I think.

13. ## Re: Standard deviation question

Originally Posted by a tutor
Sub everything in..

$\text{ new s }= s'=\sqrt{\frac{1}{22}\left((22-1)\times 0.327^2+4.33^2\times 22+5^2-\frac{1}{22+1}(4.33\times 22+5)^2\right)}$

and then calculate it. You should get 0.3486918155 which seems reasonable...I think.

I'm getting 4.5, I'm obviously doing the calculations wrongly!

14. ## Re: Standard deviation question

It's a bit awkward on a pocket calculator.

Take a look at this instead.

(1/22*((22-1)*0.327^2+4.33^2*22+5^2-1/(22+1)*(4.33*22+5)^2))^(1/2) - Wolfram|Alpha

15. ## Re: Standard deviation question

This is probably a real noob question but in what order do I do the separate calculations? Could you show me step by step. Maths is not my strong point, apologies.

Page 1 of 2 12 Last