Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Statistics formulas

Two-sample t statistic

Compare two independent population means without assuming known population spreads.

Statistics · Inference
$$t=\frac{(\bar x_1-\bar x_2)-\Delta_0}{\sqrt{s_1^2/n_1+s_2^2/n_2}}$$

Two-sample t statistic is one of 2 inference formulas in the statistics section of this library, and it is used at ap · university level.

Why two-sample t statistic works

The top is the observed gap between the groups minus the gap the null hypothesis claims. The bottom is how much that gap would wobble from sampling alone, and because the two groups are independent their variances add, which is why the two terms are summed underneath a single square root.

What each symbol means

$\Delta_0$ is the null difference, usually zero.

Two-sample t statistic: when it holds

Samples should be independent and conditions for t inference should be checked; use Welch degrees of freedom unless pooling is justified.

When it stops applying

It assumes the two samples are independent of each other. For paired measurements, such as the same subject tested twice, this statistic ignores the pairing and usually inflates the denominator, hiding a real difference that the paired analysis on the differences would have detected.

Two-sample t statistic: a worked example

Substitute both sample means, standard deviations, and sizes before comparing with a t distribution.

The mistake to avoid

What people do: Subtracting the two variance terms under the root instead of adding them.

Why it goes wrong: Uncertainty from two separate samples accumulates; it never cancels. Subtracting can even produce a negative quantity under the root, which is a sure sign the set-up is wrong.

Do this instead: Add the two squared standard errors, then take one square root of the total.

Two-sample t statistic: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $\Delta_0$ is the null difference, usually zero.
  3. Check the conditions before substituting. Samples should be independent and conditions for t inference should be checked; use Welch degrees of freedom unless pooling is justified.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most statistics slips.

Where this formula fits

Subject
Statistics formulas — 21 entries in this library
Topic
Inference
Level
AP · University

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where two-sample t statistic comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about two-sample t statistic

What degrees of freedom should I use?

The Welch formula, which software computes and which usually gives a non-whole number. For two samples of 10 with spreads of 2 and 3 it comes out to about 15.7, and a conservative hand method uses the smaller sample size minus 1.

Do the two groups need to be the same size?

No. Unequal sizes are handled automatically because each group contributes its own variance divided by its own count, so the larger group simply contributes less noise.

When is it safe to pool the two variances?

Only when there is good reason to believe the two populations have the same spread. The Welch version does not need that assumption and performs well even when the spreads do match, so it is the safer default.

How much does non-normality matter?

Very little for large samples, thanks to the central limit theorem, but a lot for small ones, especially with skewed data. Look at both samples before trusting a t procedure on fewer than about 15 observations each.

Stuck on a problem?

Work a two-sample t statistic problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.