Calculators King

Hypothesis Tests

Two Sample T-Test Calculator

A two-sample t test compares two means under equal variance by pooling the sample spreads onto one shared standard error.

Worksheet

Press Calculate to see the result.

A two-sample t test compares two means under equal variance by pooling the sample spreads onto one shared standard error.

What this calculator answers

The equal-variance two-sample t test treats the two groups as independent samples from populations that share one variance. It estimates that shared variance by pooling the two sums of squares, weights them by n minus 1, and divides by n1 plus n2 minus 2. The standard error of the mean difference then uses that pooled variance times the sum of the reciprocal sample sizes. Degrees of freedom are n1 plus n2 minus 2. This is a different statistic from Welch's test, which refuses the shared-variance step and spends a fractional df instead. Lists are preferred. Empty lists fall through to the summary boxes.

The headline is the pooled t. The page also shows the pooled variance, df, the p-value, the critical t, and the decision. Sample standard deviations use divisor n minus 1. Supporting counts and intermediate terms sit under the headline so a reader can see what was divided by what. When a checkbox or a tail setting changes the divisor or the rejection region, that choice appears in the steps rather than vanishing into a silent default.

The formula, written out

Pooled two-sample t uses this relationship.

sp^2 = ((n1-1)s1^2 + (n2-1)s2^2) / (n1+n2-2). t = (mean1-mean2) / sqrt(sp^2 (1/n1 + 1/n2)). df = n1+n2-2.

  • sp^2. Pooled variance.
  • s1 and s2. Sample standard deviations, divisor n minus 1.
  • df. n1 plus n2 minus 2.
  • t. Difference of means divided by the pooled standard error.

If both populations share a variance, the two sample variances are estimates of the same number and can be averaged with weights n minus 1. The mean difference is then divided by the square root of that pooled variance times (1/n1 plus 1/n2), which is a t statistic on the summed degrees of freedom. The algebra is the named textbook identity for this worksheet. Intermediate products and quotients appear in order so a calculator and a pencil can agree to the displayed rounding. If a neighbouring page uses a different divisor or a continuity correction, that page says so on its own ticket.

A full worked example

Example loaded in the worksheet

The loaded lists are 12, 14, 15, 16, 13 and 10, 11, 9, 12, 8, 10.

The lists were used: group 1 has 5 values and group 2 has 6. The summary boxes were ignored. Group means are 14 and 10. Sample variances, divisor n minus 1, are 2.5 and 2. Pooled variance is ((n1 minus 1) times s1 squared plus (n2 minus 1) times s2 squared) divided by (n1 plus n2 minus 2).

That is 2.2222 on 9 degrees of freedom, from n1 equal to 5 and n2 equal to 6. The pooled standard error is 0.9027, and t is 4.4313. The two-sided p-value is 0.0016 and the critical t at alpha 0.05 is 2.2622.

At the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story. Welch would not pool. On these same numbers the Welch t would be 4.3818 on about 8.1967 degrees of freedom, which is a different test from this pooled result.

Figures from the worked example
T statistic4.4313
P-value0.0016
Critical t2.2622
Degrees of freedom9
DecisionAt the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story.

A second situation

Summary boxes only, with the lists cleared

Both lists were empty, so the summary means, sample sds, and sample sizes were used. Group means are 14 and 10. Sample variances, divisor n minus 1, are 2.4999 and 2. Pooled variance is ((n1 minus 1) times s1 squared plus (n2 minus 1) times s2 squared) divided by (n1 plus n2 minus 2).

That is 2.2221 on 9 degrees of freedom, from n1 equal to 5 and n2 equal to 6. The pooled standard error is 0.9027, and t is 4.4314. The two-sided p-value is 0.0016 and the critical t at alpha 0.05 is 2.2622.

At the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story. Welch would not pool. On these same numbers the Welch t would be 4.3819 on about 8.1968 degrees of freedom, which is a different test from this pooled result.

Figures from the worked example
T statistic4.4314
P-value0.0016
Critical t2.2622
Degrees of freedom9
DecisionAt the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story.

Typing the same summaries without the lists runs the identical pooled formula. Welch's page, given the same numbers, would not pool and would not use df equal to n1 plus n2 minus 2. The second example changes the feature that this formula is sensitive to, and the ticket shows the new figure beside the same definition. That contrast is the fastest way to see which input owns the movement.

What moves when the input moves

Group 2's last value moved from 10 to 16. Group 1 stayed put. The headline result went from 4.4313 to 2.1019.

The nudged inputs

The lists were used: group 1 has 5 values and group 2 has 6. The summary boxes were ignored. Group means are 14 and 11. Sample variances, divisor n minus 1, are 2.5 and 8. Pooled variance is ((n1 minus 1) times s1 squared plus (n2 minus 1) times s2 squared) divided by (n1 plus n2 minus 2).

That is 5.5556 on 9 degrees of freedom, from n1 equal to 5 and n2 equal to 6. The pooled standard error is 1.4272, and t is 2.1019. The two-sided p-value is 0.0649 and the critical t at alpha 0.05 is 2.2622.

At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. Welch would not pool. On these same numbers the Welch t would be 2.2156 on about 8.0399 degrees of freedom, which is a different test from this pooled result.

Figures from the worked example
T statistic2.1019
P-value0.0649
Critical t2.2622
Degrees of freedom9
DecisionAt the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis.

How to read the result

A large absolute t on this df means the mean gap is awkward if the populations really share a mean and a variance. The decision uses your alpha. A close pair of sample variances is the situation where pooling is easiest to defend. Say the unit, the sample size or contract terms, and the formula name in the same sentence as the figure. A number without those three pieces invites a later reader to invent a definition that this page never used.

Say the test was pooled, quote both sample sizes, and quote df as n1 plus n2 minus 2. Readers otherwise cannot tell it from Welch. Write the result with its unit, the inputs that produced it, and the name of the formula. If the ticket shows a decision sentence, quote the alpha and the tail with it. If the ticket shows a money or dose figure, quote the rate and the schedule that produced it.

Assumptions that have to stay true

  • The groups are independent, not paired.
  • The two population variances are equal enough to share one estimate.
  • Each group is close to normal, or both samples are decently large.
  • The sd values, if typed, already use divisor n minus 1.

If an assumption above is false, do not average the discomfort away. Change the worksheet or change the question. A correct arithmetic step on the wrong model is still the wrong answer for the decision you are trying to make.

Mistakes that change the answer

  • Pooling when one group is much more spread out than the other. That is Welch's job.
  • Using n1 plus n2 minus 1 as df.
  • Running this test on before-and-after rows. Those are paired.
  • Averaging the two variances without the n minus 1 weights when the samples differ in size.

Where a different calculator is the honest choice

Welch's t-test calculator is the safer page when the spreads differ. The paired t-test calculator is the page for matched rows. The t-test calculator can run this pooled test from a chooser, and it also offers the one-sample and paired layouts. Related links under the essay open pages that keep their own formulas instead of hiding a mode switch inside this ticket.

When the job changes, move to a page built for that job: Welch's T-Test Calculator, Paired T-Test Calculator, T-Test Calculator.

Check yourself

Group 1 is 12, 14, 15, 16, 13 and group 2 is 10, 11, 9, 12, 8, 10. What is the pooled two-sided t?

The pooled t statistic is 4.4313 on 9 degrees of freedom.

Using the result in a sentence

Two teaching methods with similar score spreads, or two batches with similar lab noise, are the classic pooled-t settings. Wildly different spreads should move to Welch before you quote this df. Keep the count, the unit, and the assumption list beside any copy of the number that leaves this browser tab.

Equal variance is an assumption, not a gift from the formula. A significant t does not say the groups differ by a useful amount, and it does not survive if the rows were actually paired. Pair the headline with the steps before you staff a route, set a grade boundary, or compare two contracts from a single number.

Questions people ask next

01What definition does the Two Sample T-Test Calculator commit to?

This page uses Pooled two-sample t: sp^2 = ((n1-1)s1^2 + (n2-1)s2^2) / (n1+n2-2). t = (mean1-mean2) / sqrt(sp^2 (1/n1 + 1/n2)). df = n1+n2-2.. If both populations share a variance, the two sample variances are estimates of the same number and can be averaged with weights n minus 1. The mean difference is then divided by the square root of that pooled variance times (1/n1 plus 1/n2), which is a t statistic on the summed degrees of freedom. If a textbook uses a different divisor, a different continuity correction, or a different rounding rule, the last digits can move, so the definition is printed above the result. The worksheet asks for Group 1 data, Group 2 data, Mean 1, s1, n1, Mean 2, and related inputs, and it refuses a blank that the formula cannot interpret. Keep that printed definition in the sentence you write next to the figure so a later reader can rebuild the arithmetic without guessing which convention you chose.

02How should the worked example be read out loud?

In the loaded example the t statistic is 4.4313. A large absolute t on this df means the mean gap is awkward if the populations really share a mean and a variance. The decision uses your alpha. A close pair of sample variances is the situation where pooling is easiest to defend. Say the unit and the count before you say whether the number is large or small. Read the steps in order rather than jumping to the headline, because the intermediate terms are where a swapped percent and proportion usually hide. If the ticket shows both a primary figure and a comparison figure, name which one you are quoting.

03What is the fastest way to get a misleading result?

Pooling when one group is much more spread out than the other. That is Welch's job. Equal variance is an assumption, not a gift from the formula. A significant t does not say the groups differ by a useful amount, and it does not survive if the rows were actually paired. A second common failure is leaving a checkbox or tail setting in the wrong state and then treating the number as if the default had matched your plan. Reset the example, change one input, and confirm the ticket moves in the direction the formula predicts before you trust a live run.

04When should I leave this page for a different calculator?

Welch's t-test calculator is the safer page when the spreads differ. The paired t-test calculator is the page for matched rows. The t-test calculator can run this pooled test from a chooser, and it also offers the one-sample and paired layouts. The related links under the essay go to those worksheets, which keep their own formulas instead of hiding them in a mode switch. If the question changed from a summary to a test, from a payment to a refinance, or from a raw score to a percentile, switch pages rather than forcing this ticket to answer a job it was not built for.

05What belongs in the sentence next to the number?

The pooled t statistic is 4.4313 on 9 degrees of freedom. Say the test was pooled, quote both sample sizes, and quote df as n1 plus n2 minus 2. Readers otherwise cannot tell it from Welch. A bare number without those three pieces cannot be audited when a score, a rate, or a lab value is challenged later. Store the inputs beside the result whenever the figure will travel into a report.