# Help Beginner Q: Explanation on pooled variance and when it is used

If I am conducting a difference in means hypothesis test, when do we use the pooled variance and why?

Lets say the population variance was unknown for two samples, the sample sizes for the two means were small (around 20) and they follow a normal distribution. Therefore I would be using a t distribution. In this case, can't we just do a difference of means hypothesis test by adding the variances together e.g Var(X)/n1 + Var(Y)/n2 and then square rooting, (as shown below).

$t = \frac{(\bar{X}_{x}- \bar{X}_{y})-(\mu_{x}-\mu_{y})}{\sqrt{\left(\frac{\sigma^{2}_{x}}{n_x}+ \frac{\sigma^{2}_{y}}{n_y} \right)}}$

Since we can add variances for independent random variables, why is it necessary to pool? Similarly, for difference of means tests where a Z statistic is calculated (samples size large and true sample variances are known), why is it that the variances are never pooled and are added instead?

Please can someone explain what I am missing here.

If you have good reasons to believe that the variance of the two populations are equal, then it makes sense to use this information to improve the efficiency of your estimate.

In this case, your test statistic becomes:

$$t=\frac{(\bar{x}_x-\bar{x}_y)-(\mu_x-\mu_y)}{s\sqrt{\frac{1}{n_x}+\frac{1}{n_y}}}$$

So instead of having to estimate two variances, $\sigma_x^2$ and $\sigma_y^2$, you now have to estimate only one, $\sigma^2$.

In principle you could use any of the two sample variance estimates, but this would be ignoring part of the available information. Surely we can do better than that and combine the information from the two samples.

One way to combine the variances estimates of different samples in an unbiased way is to use the pooled variance estimate:

$$s_{pooled}^2 = \frac{(n_x-1)s_x^2 + (n_y-1)s_y^2}{n_x+n_y-2}$$

Where $s_x^2$ and $s_y^2$ are the unbiased sample variance estimates: $s_x^2 = \frac{1}{n_x-1}\sum_{i=1}^{n_x}(x_i-\bar{x}_x)^2$ (similarly for $s_y^2)$.

Edited after I understood the second part of your question:

• The pooled variance $s^2_{pooled}$, as above, which is an estimate of $\sigma^2$
• The variance of the difference of two sample means, with sample size $n_x$ and $n_y$ and corresponding variance $\sigma_x^2$ and $\sigma_y^2$, which is: $var(\bar{x}_x-\bar{x}_y)=\frac{\sigma_x^2}{n_x}+\frac{\sigma_y^2}{n_y}$.

Note that the latter, which you find in square roots in the denominator of your t statistic, is the variance of the value of interest - the difference in the two means. It does not have to do with estimating a variance; rather, it has to do with standardizing your statistic.

• Nicely explained! I took the liberty of making your key formulas a little more prominent (simply enclose them in two dollar signs rather than one). I fixed a few minor typos, too--please check that I didn't ruin anything. Welcome to our site.
– whuber
May 26 '16 at 19:37
• My second question was that often when we do hypothesis tests involving the Z statistic it looks something like this: $$Z=\frac{(\bar{X}_{x}- \bar{X}_{y})-(\mu_{x}-\mu_{y})}{\sqrt{\left(\frac{\sigma^{2}_{x}}{n_x}+ \frac{\sigma^{2}_{y}}{n_y} \right)}}$$, the variance is just added and not pooled. Why is this? If the variances were assumed to be equal for any 2 given populations then is it true to say that a pooled variance will always be more accurate then the sum of the two variances? May 26 '16 at 19:54
• @whuber: thank you very much for your warm welcome and edits, very much appreciated. I hope I will be able to contribute, if only by a fraction of what this site has given me in the past. user117031: I understand your confusion and I edited my answer accordingly. Tell me if it makes sense now.
– wiwh
May 26 '16 at 20:53
• user117031, Re your comment: it's not a question of accuracy, but of test power. When the null hypothesis is not true, the variances may be different. You increase the ability to detect a difference in means by separately estimating those variances.
– whuber
May 26 '16 at 20:57
• Thank you for taking the time to answer my question. The confusion I had has been resolved. Appreciate your help. May 26 '16 at 22:52