




















A t‑test is a hypothesis test used when you want to compare means but you don’t know the population standard deviation and your sample size is small.
It’s used for:
One‑sample t‑test → compare one sample mean to a known value
Independent‑samples t‑test → compare two unrelated groups
Paired‑samples t‑test → compare the same people before/after or matched pairs
All of these rely on the t‑distribution instead of the normal distribution.
Why we need the t‑test
When the sample is small, the sample standard deviation is a noisy estimate of the population standard deviation
.
This extra uncertainty makes the sampling distribution wider than the normal curve.
The t‑test accounts for this by using the t‑distribution, which has heavier tails.
Student’s t‑distribution
🎯 What it is
A probability distribution used when:
- The population mean is unknown
- The population standard deviation is unknown
- The sample size is small
- The data are (approximately) normal
It looks like a normal distribution but with fatter tails — meaning more probability in the extremes.
Degrees of freedom (df)
The shape of the t‑distribution depends on degrees of freedom, usually:
Small df → very wide, heavy‑tailed
Large df → approaches the normal distribution
By around , the t‑distribution is almost indistinguishable from the normal curve.
How the t‑test uses the t‑distribution
The test statistic is:
This t‑value is then compared to the t‑distribution with to compute a p‑value.
Fresh, original examples
🧪 Example 1: One‑sample t‑test
A cereal company claims the mean sugar content is 10 g.
You sample 12 boxes and get a mean of 9.2 g with .
You test whether the true mean differs from 10 → one‑sample t‑test using the t‑distribution with .
👟 Example 2: Independent‑samples t‑test
You compare running speeds of:
- Group A: people who train in the morning
- Group B: people who train in the evening
Two unrelated groups → independent‑samples t‑test, using a t‑distribution with based on both sample sizes.
🧠 Example 3: Paired t‑test
You measure memory scores before and after a training program on the same participants.
Differences are computed for each person → paired t‑test, using the t‑distribution with .
Why it’s called “Student’s” t‑test
It was created by William Sealy Gosset, a statistician at Guinness Brewery.
He wasn’t allowed to publish under his real name, so he used the pseudonym “Student.”
Hence: Student’s t‑test and Student’s t‑distribution.