If I know the mean, standard deviation, and size of sample A and sample B, how do I compute the standard deviation of the union of samples A and B? What if samples A and B are of different sizes?

1 Answer
Sep 12, 2016

Please see below.

Explanation:

Let us start with samples with unequal sizes.

Let the mean, standard deviation and size of sample #A# be #barX_A#, #S_A# and #n_A# respectively

and mean, standard deviation and size of sample #B# be #barX_B#, #S_B# and #n_B# respectively.

Then mean of comibined sample #barX# is given by

#barX=(n_AbarX_A+n_BbarX_B)/(n_A+n_B)#

and Standard Deviation of combined sample #S# is

#S=(n_A(S_A^2+(barX_A-barX)^2)+n_B(S_B^2+(barX_B-barX)^2))/(n_A+n_B)#

Note that it is important to work out mean of combined sample first, as to is used to calculate Standard Deviation of combined sample.

If the sample sizes are equal then the above reduces to

#barX=(barX_A+barX_B)/2# and

#S=((S_A^2+(barX_A-barX)^2)+(S_B^2+(barX_B-barX)^2))/2#