Student's t-Test: Types, Formula and Worked Examples
The Student's t-test checks whether a mean, or the difference between two means, is large enough to be real rather than chance. It is one of the most used tests in Lean Six Sigma, especially in the Analyse and Improve phases. This guide explains the types, the formula and a worked example.
Why is it called Student's t-test?
William Sealy Gosset developed the test while working at the Guinness brewery in Dublin, where he needed to judge small samples of barley and beer. Guinness did not want staff to publish under their own names, so he published his work in 1908 under the pen name Student. The name stuck.
The three types of t-test
| Type | Question | Example |
|---|---|---|
| One-sample t-test | Does the mean differ from a target value? | Is the average fill weight different from 500 g? |
| Two-sample (independent) t-test | Do two separate groups have different means? | Do day and night shifts take different times? |
| Paired t-test | Did the same items change between two measurements? | Did each machine's output change after maintenance? |
The classic Student's two-sample test assumes the two groups have equal variances. Welch's version drops that assumption and is the safer default when you are not sure. Read our two-sample t-test guide for a worked two-group example.
The formula (one-sample)
t = (x̄ − μ) ÷ (s ÷ √n), where x̄ is the sample mean, μ is the target, s is the sample standard deviation and n is the sample size. Degrees of freedom = n − 1.
Worked example: is the fill weight on target?
- Question. A filler should put 500 g in each pack. A sample of 10 packs has a mean of 497 g and a standard deviation of 4 g.
- Hypotheses. Null: the true mean is 500 g. Alternative: it is not.
- Standard error. 4 ÷ √10 = 1.265.
- t statistic. (497 − 500) ÷ 1.265 = −2.37.
- Critical value. With 9 degrees of freedom and a 5% two-sided test, the critical value is ±2.262.
- Decision. −2.37 is beyond −2.262, and the p-value is about 0.042. Reject the null: the filler is running about 3 g light and needs adjusting.
Assumptions to check
- The data is continuous, such as time, weight or cost.
- Observations are independent of each other.
- The data is roughly normal, or the sample is large (about 30 or more per group).
- For the classic two-sample test, the variances are similar. If not, use Welch's test.
If the data is clearly not normal and the sample is small, use a non-parametric test instead, such as the Mann-Whitney test for two groups or the Wilcoxon signed-rank test for paired data.
How to run a t-test in software
- Excel: =T.TEST(range1, range2, tails, type), where type 1 is paired, 2 is equal variance and 3 is unequal variance. The Analysis ToolPak gives the full output.
- Minitab: Stat, Basic Statistics, then 1-Sample t, 2-Sample t or Paired t.
Frequently asked questions
What is Student's t-test used for?
To test whether a sample mean differs from a target, whether two groups have different means, or whether paired measurements changed. It works well with small samples.
What are the types of Student's t-test?
One-sample, independent two-sample and paired. The classic two-sample version assumes equal variances, and Welch's version does not.
Why is it called Student's t-test?
Because William Sealy Gosset published it in 1908 under the pen name Student while working at the Guinness brewery.
What is the difference between a paired and an unpaired t-test?
A paired t-test compares two measurements on the same items, such as before and after. An unpaired (independent) t-test compares two separate groups.