Statistical Calculators

Two-Sample t-Test Calculator (Pooled and Welch)

Enter the mean, the standard deviation, and the size of each of two independent groups. The page carries both forms of the test, pooled and Welch, and each returns the confidence interval for the difference, the t statistic, the p-value, and a conclusion in plain words.

Two forms sit on this page. The pooled form assumes the two groups share one variance, and spends the degrees of freedom on that basis. The Welch form assumes nothing about equal variances, and adjusts the degrees of freedom to the two spreads. When the spreads look close, the two answers sit close. When the spreads differ a lot, the Welch form is the safer default.

Two-sample t calculator, pooled

The design effect stays at 1 for a simple random sample. A survey sample from a complex design enters its design effect, and the standard error widens by the square root of that value.

Two-sample t calculator, Welch

The design effect stays at 1 for a simple random sample. A survey sample from a complex design enters its design effect, and the standard error widens by the square root of that value.

How these calculators work

Both forms compare the means of two independent groups. The quantity of interest is the difference between the group means. The interval covers that difference, and the test judges the difference against a stated value, most often zero.

The pooled form first combines the two sample variances into one pooled variance, weighted by the degrees of freedom of each group. Its degrees of freedom are the two sample sizes added, minus two. The Welch form builds the standard error from the two variances separately, and its degrees of freedom come from the Welch-Satterthwaite formula. That count is printed with its decimals, because the formula rarely gives a whole number.

Worked example

Group 1 has 30 observations, a mean of 85, and a standard deviation of 10. Group 2 has 28 observations, a mean of 80, and a standard deviation of 12. The difference is 5. On the pooled form, the standard error is 2.893, the t statistic is 1.728 at 56 degrees of freedom, and the p-value is 0.0894. The 95 percent interval for the difference runs from -0.80 to 10.80. The interval covers zero and the p-value sits above 0.05, so the test does not reject equal means.

Values computed from the t distribution. The method was checked against reference calculations: the entries in the worked example reproduce to four decimal places, and the full pair record sits in the package verification file.