STEM-TutorLearn • Practice • ExcelBook Free DemoFree demo

The t-test, explained with examples

A t-test checks whether a mean, or a difference between means, is significantly different from a claimed value. It is the workhorse test for quantitative data in AP Statistics and in real research.

On this page
  1. Why t instead of z?
  2. The t statistic
  3. Conditions
  4. The four steps
  5. Worked examples
  6. Paired or two-sample?
  7. When the result is not significant
  8. Degrees of freedom
  9. Using a calculator
  10. Common mistakes
  11. Practice questions
  12. Frequently asked questions
  13. Key takeaways
  14. Related guides

Why t instead of z?

To test a claim about a population mean μ, we compare the sample mean x̄ with the claimed value. If we knew the population standard deviation σ, we could use a z statistic. In practice σ is almost never known, so we estimate it with the sample standard deviation s. That extra uncertainty is handled by the t distribution, which looks like the normal curve but has heavier tails, especially for small samples. As the sample size grows, the t distribution gets closer to the normal distribution.

The t statistic

t = (x̄ − μ0) / (s / √n), with df = n − 1 degrees of freedom.

The denominator s/√n is the standard error of the mean. The t statistic tells you how many standard errors the sample mean is from the claimed value. Large values of |t| give evidence against H0.

Conditions

  1. Random: a random sample or a randomised experiment.
  2. 10% condition: when sampling without replacement, n is at most 10% of the population.
  3. Normal/large sample: the population is approximately normal, or n ≥ 30. For small samples, check a dotplot or boxplot of the data for strong skewness or outliers.

The four steps

Every AP significance test follows the same structure: State the hypotheses and significance level with the parameter defined in context; Plan by naming the test and checking conditions; Do the calculation of t, df and the P-value; and Conclude by comparing the P-value with α and answering in context.

Worked examples

Example 1: a one-sample t-test

A company claims its batteries last 40 hours on average. A random sample of 16 batteries has mean 38.2 hours and standard deviation 3.0 hours. Is there evidence at α = 0.05 that the mean is less than 40 hours?

Example 2: a paired t-test

Eight students took a test before and after a revision course. The mean of the differences (after − before) was 4.5 points, with standard deviation 5.2. Test whether the course improves scores, at α = 0.05.

Example 3: a two-sample t-test

Random samples of commuters: by train, n = 25, mean 42 minutes, s = 8; by car, n = 30, mean 48 minutes, s = 10. Is there a difference in mean commute times? Use α = 0.05.

Paired or two-sample?

This choice is a favourite AP question. Use a paired test when each observation in one group is naturally matched with one in the other: the same people before and after, twins, or left and right hands of the same person. Use a two-sample test when the groups are independent, such as two separate random samples. Using a two-sample test on paired data throws away the matching and usually makes it harder to detect a real effect.

When the result is not significant

If the P-value is larger than α, write: “Because the P-value is greater than α, we fail to reject H0. There is not convincing evidence that …”. This does not prove the claim is true. A small sample may simply be unable to detect a real but modest difference, which is a Type II error risk.

Degrees of freedom

For one-sample and paired tests, df = n − 1. For a two-sample test, the exact df comes from a complicated formula that calculators handle automatically. A conservative approach, if you are working by hand, is to use the smaller of n1 − 1 and n2 − 1. Fewer degrees of freedom give a slightly larger P-value, so the conservative choice is safe.

Using a calculator

On a TI-84, T-Test handles one-sample and paired data (enter the differences as one list), and 2-SampTTest handles independent samples; choose “Pooled: No” for AP Statistics. On the exam, always write the test name, t, df and P-value, not just the calculator's output.

Common mistakes

Practice questions

Try each one before opening the answer.

Q1. x̄ = 52, μ0 = 50, s = 6, n = 36. Find t.

Show answer
t = 2/(6/6) = 2.0, df = 35.

Q2. Twenty patients have blood pressure measured before and after a drug. Which test?

Show answer
A paired t-test on the differences.

Q3. Two random samples of 40 bulbs from different factories are compared. Which test?

Show answer
A two-sample t-test.

Q4. As n increases, what happens to the t distribution?

Show answer
It gets closer to the normal distribution.

Frequently asked questions

Is the t-test on the AP Statistics exam?

Yes. Inference for means, including one-sample, paired and two-sample t procedures, is Unit 7 and appears on almost every free-response section.

Is the t-test in A level Maths?

No. A level Maths hypothesis testing uses the binomial and normal distributions. The t-test is in some Further Maths options and is used widely at university.

Key takeaways