Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
1  
How do you get standard deviations of 1.11, 1.75 and 1.4286? They look rather low. –  Henry Feb 17 '11 at 12:36
    
oops, you are right, it is not. Awful mistake. will edit it now –  baderous Feb 17 '11 at 14:23
add comment

1 Answer

up vote 2 down vote accepted

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).

share|improve this answer
    
it definitely is! thank you. :) –  baderous Feb 17 '11 at 15:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.