AP® Statistics · Unit 4 · Topic 4.5

Carrying Out a One-Sample t-Test

A one-sample t-test checks whether a sample mean is far enough from a claimed value, measured in standard errors, to doubt the claim. Since the population standard deviation is unknown, you use s and the t-distribution instead of z.

The t statistic answers one question: how many standard errors is x-bar away from the null value mu0? You compute t = (x-bar - mu0) / (s / √n). The denominator, s/√n, is the standard error of the mean, your best estimate of how much sample means bounce around from sample to sample. Dividing by it rescales the gap into a universal unit. A t of 2 always means the sample mean sits two standard errors from what was claimed, whether you're weighing bags of chips or measuring reaction times. Because s is estimated from the data rather than known exactly, that extra uncertainty makes the t-distribution a bit heavier in the tails than the normal curve, especially with small n.

Running the test has four steps. First, state hypotheses in terms of the population mean mu, and check conditions: the sample should be random, and either the population is roughly normal or n is large enough (often n ≥ 30, or a dotplot/histogram shows no strong skew or outliers for small n). Second, calculate the test statistic t = (x-bar - mu0)/(s/√n) and note degrees of freedom, n - 1. Third, find the p-value from the t-distribution with that many degrees of freedom, using the direction given by the alternative hypothesis. Fourth, compare the p-value to your significance level alpha and state a conclusion in context: reject H0 if p < alpha, otherwise fail to reject.

This topic is the mean version of the one-sample z-test for proportions you've already seen, and it sets up every t-test that follows, including paired and two-sample versions, which all reuse this same four-step skeleton with a different standard error formula.

Key terms

t statistic
The number of standard errors the sample mean lies from the hypothesized population mean.
standard error
s divided by √n; it estimates how much sample means vary from the true mean.
degrees of freedom
n - 1 for a one-sample t-test; it determines the exact shape of the t-distribution used.
p-value
The probability of getting a t statistic at least as extreme as observed, assuming H0 is true.

Watch it explained

  1. How it worksWalk me through the four steps of a t-test for a population mean.
  2. Worked exampleFind the t statistic and p-value for n = 20, x-bar 48.6, s 7.2, testing mu = 45.
  3. Worked exampleFind the p-value testing whether 30 bags average less than the 500 grams claimed.

Check yourself

Your turn1 of 2
For a sample with n = 22, x-bar = 50, and s = 10, find the t statistic for testing H0: mu = 38.

End of topic.