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
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
Need to be careful here, since the mean of the population changes with the addition of the new data point. Starting with
$\displaystyle \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:
$\displaystyle \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 $\displaystyle \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 $\displaystyle \sigma_{n+1}^2 = \frac 1 n \sum_{i=1}^{n+1} (x_i - \mu_n)^2$.
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.
OK:
Let $\displaystyle \sigma_1 $ be the original standard deviation, $\displaystyle \mu_1$ be the original mean, and $\displaystyle N$ = the number of data points you started with (20 in your case). Let $\displaystyle x$ be the new data point that you are now going to include. You are interested in calculating the new standard deviation $\displaystyle \sigma_2$ and mean $\displaystyle \mu_2$. The calculation is:
1. $\displaystyle \mu_2 = \frac {N \mu_1 + x} {N+1}$
2. $\displaystyle \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.
Is there an error in ebaines formula?
If the standard deviation were calculated using $\displaystyle 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
$\displaystyle \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)}$
$\displaystyle \text{ new m }= m' = \frac{mn+x}{n+1}$
Sub everything in..
$\displaystyle \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.
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