A difference between groups has uncertainty too

Two separate groups of 25 people have mean blood-pressure reductions of 6 and 3 mmHg. Both sample SDs are 6 mmHg. The estimated difference is therefore 3 mmHg.

Keep both means and SDs fixed. Increase each group to 100 people and compare the uncertainty of the same difference.

Follow the maths
Estimated difference...
95% confidence interval...
Signed Cohen's d...
Selected p-value...

t = …; estimated SE = …

1 · Compare the sample estimate with the null value

The circle is the sample estimate. The diamond is the null value. The blue horizontal bar extends one standard error on either side of the estimate. The thinner teal bar is the two-sided 95% confidence interval. The axis uses original measurement units. A two-sided 95% interval corresponds to a two-sided 5% test; directional tests use different rejection regions.

2 · Read the p-value under the null hypothesis

Imagine repeating the study when the null hypothesis is true. This curve shows the distribution of the resulting t scores, not the distribution of individual measurements. The vertical line marks your t score. The shaded area is the p-value for your chosen alternative.

Worked comparison

Follow the calculation

t=x¯1−x¯2sp1n1+1n2
What the symbols mean

x̄₁ and x̄₂ are sample means. sₚ is the pooled sample standard deviation. n₁ and n₂ are the sample sizes. The denominator estimates the standard error of the mean difference.

Assumptions and full calculation

This is the pooled equal-variance test for different participants in the two groups. Repeated measurements on the same participants require a paired approach. The applet gives both groups the same sample SD for illustration; the pooled test in general does not require identical sample SDs. Welch's test, which allows unequal population variances, is outside this applet's model. Here the pooled SD is s. The test has n₁ + n₂ − 2 degrees of freedom. Exact p-values assume independent observations from normal populations with equal variances. Plot 1 shows the observed mean difference and its estimated standard error. Plot 2 shows the distribution of t when the population means are equal. Choose the alternative before looking at the data.

Degrees of freedom and other tail probabilities
Degrees of freedom...
Lower-tail p...
Upper-tail p...
Two-sided p...

The selected p-value above uses your chosen alternative hypothesis. The other p-values use the alternatives shown here. Divide the observed difference by the pooled sample standard deviation to get the effect size. Its sign follows the order of subtraction.