# Standart deviation for two groups

• Sep 8th 2008, 02:45 AM
Pumata
Standart deviation for two groups
Hello guys,
Here is my problem. I have two groups the first one is from 42 members and the second -36. I have the average of the two groups and their standard deviation value, but i don't have their individual results. How can I calculate the average and standard deviation for the whole 78 members.
• Sep 8th 2008, 03:28 AM
mr fantastic
Quote:

Originally Posted by Pumata
Hello guys,
Here is my problem. I have two groups the first one is from 42 members and the second -36. I have the average of the two groups and their standard deviation value, but i don't have their individual results. How can I calculate the average and standard deviation for the whole 78 members.

Let group 1 have a mean $\displaystyle \bar{x}$, variance $\displaystyle s_x^2$ and be of size n. Then:

$\displaystyle \bar{x} = \frac{\sum_{i=1}^{n} x_i}{n} \Rightarrow \sum_{i=1}^{n} x_i = n \bar{x}$ .... (1)

$\displaystyle s_x^2 = \frac{\sum_{i=1}^{n} x_i^2}{n} - \bar{x}^2 \Rightarrow n\left(s_x^2 + \bar{x}^2 \right) = \sum_{i=1}^{n} x_i^2$ .... (2)

Let group 2 have a mean $\displaystyle \bar{y}$, variance $\displaystyle s_y^2$ and be of size m. Then:

$\displaystyle \bar{y} = \frac{\sum_{i=1}^{m} y_i}{m} \Rightarrow \sum_{i=1}^{m} y_i = m \bar{y}$ .... (3)

$\displaystyle s_y^2 = \frac{\sum_{i=1}^{m} y_i^2}{m} - \bar{y}^2 \Rightarrow m \left(s_y^2 + \bar{y}^2 \right) = \sum_{i=1}^{m} y_i^2$ .... (4)

Let the whole group (group 1 plus group 2) have a mean $\displaystyle \bar{z}$ and variance $\displaystyle s_z^2$. The whole group has size n + m. Then:

$\displaystyle \bar{z} = \frac{\sum_{i=1}^{n+m} z_i}{n + m} = \frac{\sum_{i=1}^{n} x_i + \sum_{i=1}^{m} y_i }{n + m}$.

Substitute from (1) and (3): $\displaystyle \bar{z} = \frac{n \bar{x} + m \bar{y}}{n+m}$.

$\displaystyle s_z^2 = \frac{\sum_{i=1}^{n+m} z_i^2}{n+m} - \bar{z}^2 = \frac{\sum_{i=1}^{n} x_i^2 + \sum_{i=1}^{m} y_i^2}{n+m} - \bar{z}^2$.

Substitute from (2) and (4): $\displaystyle s_z^2 = \frac{n \left( s_x^2 + \bar{x}^2 \right) + m \left( s_y^2 + \bar{y}^2 \right)}{n+m} - \bar{z}^2$
• Sep 8th 2008, 04:10 AM
Pumata
Thank you mr fantastic!
The last formula was what I was searching for :) (Bow)