ABWex / Tools / Pooled standard deviation calculator
Pooled standard deviation calculator
Pooling two standard deviations is one line of algebra, and most calculators stop there. The number is only useful because of what it feeds, so this one also runs the test it feeds and tells you when pooling is the wrong thing to do.
Enter your two groups
Give each group a size, a mean and a standard deviation. If you have the raw numbers instead, paste them and the summary statistics are computed for you.
Group A
Group B
The formula, and the assumption hiding inside it
The pooled standard deviation is the square root of a weighted average of the two sample variances, weighted by degrees of freedom.
s_p = sqrt( ( (n1 - 1) s1^2 + (n2 - 1) s2^2 ) / (n1 + n2 - 2) )
Read the weighting carefully, because it is where the assumption lives. Each variance is weighted by its own degrees of freedom, so the larger sample dominates the pooled figure. That is the right thing to do only if both groups are drawn from populations with the same variance. Pooling is not an averaging convenience. It is a claim that one number describes the spread of both groups.
When that claim is false, the pooled value sits between the two real spreads and describes neither. The calculator above reports the ratio of the two sample variances so you can see how strong the claim is before you rely on it.
What the pooled value is actually for
On its own the pooled standard deviation answers no question. It exists to feed three things, and the calculator returns all three rather than making you carry the number somewhere else.
| Quantity | Formula | What it tells you |
|---|---|---|
| Student t | (m1 - m2) / (s_p sqrt(1/n1 + 1/n2)) | Whether the difference in means is larger than sampling noise, assuming equal variances |
| Cohen's d | (m1 - m2) / s_p | The size of the difference in standard deviations, which is what meta-analysis and power calculations consume |
| Confidence interval | (m1 - m2) +/- t s_p sqrt(1/n1 + 1/n2) | The range of differences the data is consistent with |
Cohen's d is the reason most people arrive at a pooled standard deviation without knowing it. The denominator of d is the pooled value, so a wrong pooling assumption propagates straight into a reported effect size.
When not to pool, and what to do instead
If the two variances are far apart, the Student t test built on a pooled standard deviation reports a confidence it has not earned. The fix is not to pool at all. Welch's t test uses each group's own variance and adjusts the degrees of freedom, and it does not require the equal variance assumption.
The calculator runs both tests every time and prints them side by side, because the honest comparison is the point. If they agree, the pooling assumption did no harm. If they disagree, the assumption is doing the work rather than the data, and Welch is the one to report.
A common rule of thumb is that pooling is safe when the larger sample standard deviation is less than twice the smaller one. That rule is a convenience rather than a theorem, so the calculator prints the actual ratio and lets you judge it. Welch is the safer default in almost every case, and the cost of using it when variances really are equal is very small.
How we know these numbers are right
Every value on this page is computed in your browser from the inputs shown above. Nothing is typed into the copy by hand and nothing is sent to a server.
The routines are the same ones the rest of this site runs on, published under the MIT licence at github.com/theluckystrike/abwex.com. The t distribution tail uses a regularised incomplete beta function evaluated by continued fraction, which is the standard approach and is the same method scipy.stats.ttest_ind documents for the two sample case.
SciPy documents the equal variance switch explicitly. Its equal_var argument defaults to true, which performs the standard independent two sample test that assumes equal population variances, and setting it to false performs Welch's t test, which does not assume equal population variance. That is the same choice this page surfaces, and it is surfaced rather than decided for you.
The Welch degrees of freedom use the Welch Satterthwaite equation, which is what both SciPy and R's t.test use. R's documentation states that if the variance equality option is true then the pooled variance is used to estimate the variance, and otherwise the Welch approximation to the degrees of freedom is used.
What has to be true for these numbers to hold
- The two samples are independent. Paired or repeated measurements on the same units need a paired test instead, and pooling across them understates the noise.
- Each sample is drawn at random from its population, and each observation counts once.
- The sampling distribution of each mean is approximately normal. With small samples that requires the underlying data to be roughly normal, and with larger samples the central limit theorem does most of the work.
- For the pooled figure specifically, the two population variances are equal. The calculator reports the observed variance ratio so you can see how well that holds.
- A standard deviation entered as a population value rather than a sample value will bias the pooled result. This page expects sample standard deviations, with the n minus 1 denominator.
Common questions
Read this before you act on the output
- Results are statistical estimates and not business or financial advice.
- A statistically significant result is not the same as a difference that is worth acting on.
- A p value is the probability of seeing data this extreme if the null hypothesis is true, it is not the probability that one group is better.
- Worked examples use the inputs printed on the page and will not match your own data.
- For a high stakes decision, have the design and the result reviewed by a qualified analyst.
Related, false discovery rate calculator for when you are comparing more than one metric at a time, and the t test calculator for the single comparison case.