0
$\begingroup$

I have:
A1: {3, 5, 6} and A2: {3, 4, 6, 8}

Avg A1: 4.(6)
Std.Deviation A1: 1.247

Avg A2: 5.25
Std. Deviation A2: 1.92

Merging A1 and A2, we get
A12: {3, 3, 4, 5, 6, 6, 8}

Avg A12: 5
Std. Deviation A12: 1.69

I want to be able to obtain those values (avg and std. deviation for A12), having only the following information about A1 and A2:

A1
No. Elements: 3
Avg A1: 4.(6)
Std.Deviation A1: 1.247

A2
No. Elements: 4
Avg A2: 5.25
Std.Deviation A2: 1.92

Average is easy, (4.(6)*3 + 5.25*4)/7 = 5

But I seem to be unable to calculate the correct std. deviation value. I can only use the above information. Any ideas?

  • 0
    oops, you are right, it is not. Awful mistake. will edit it now2011-02-17

1 Answers 1

2

If $\sigma$ is the (population) standard deviation then

$\sigma^2 = \frac{\sum (x_i - \mu)^2}{n} = \frac{\sum x_i^2}{n} - \mu^2$

so using the subscripts $1$, $2$ and $C$ for the first part, second part and combination

$\sigma_C^2 = \frac{n_1 (\sigma_1^2 + \mu_1^2) + n_2 (\sigma_2^2 + \mu_2^2)}{n_1+n_2} - \mu_C^2$

where $\mu_C = \frac{n_1 \mu_1 + n_2 \mu_2}{n_1+n_2}$ as you have. Then take the square root.

I think this is easier to understand than Wikipedia's version though theirs is better if rounding errors are an issue (e.g. with large means close to each other and small standard deviations).

  • 0
    it definitely is! thank you. :)2011-02-17