Hypothesis Tests for Means
A hypothesis test for a mean is a formal statistical procedure that lets us decide whether sample data provides convincing evidence that a population mean differs from some claimed value. For example, a school nutritionist might claim the average student eats 2,000 calories per day. After surveying 30 students, we obtain a sample mean and ask: is this result far enough from 2,000 to cast serious doubt on that claim, or could the difference simply be due to random sampling variation? Because we almost never know the true population standard deviation σ, we substitute the sample standard deviation s and use the t-distribution instead of the normal distribution. The t-distribution is bell-shaped and symmetric like the standard normal, but has heavier tails that account for the extra uncertainty introduced by estimating σ. As the sample size grows, the t-distribution approaches the normal distribution, so the two procedures converge for large samples. Hypothesis tests for means follow a structured four-step framework: state the hypotheses, check conditions, compute the test statistic, and draw a conclusion using a p-value or critical value. Mastering this framework builds the foundation for all of inferential statistics and is directly applicable to scientific research, medicine, business analytics, and public policy.
- State the Hypotheses
- Check Conditions
- Calculate the Test Statistic
- Make a Conclusion
State the Hypotheses
Write two competing claims. The null hypothesis H₀ always states that the population mean equals a specific value μ₀: H₀: μ = μ₀. The alternative hypothesis Hₐ reflects what you are trying to show. It can be two-sided (Hₐ: μ ≠ μ₀), left-sided (Hₐ: μ < μ₀), or right-sided (Hₐ: μ > μ₀). Choose the direction before looking at the data — choosing it after is considered p-hacking and is scientifically invalid.
Check Conditions
Three conditions must be satisfied. (1) Random: the data come from a random sample or randomized experiment. (2) Independence: individual observations are independent. If sampling without replacement, the sample size n must be at most 10% of the population. (3) Normality: either the population is approximately normal, or n ≥ 30 (Central Limit Theorem). For 15 ≤ n < 30, check that the data contain no strong skew or outliers. For n < 15, the population must be approximately normal.
Calculate the Test Statistic
Compute the one-sample t-statistic: t = (x̄ − μ₀) / (s / √n), where x̄ is the sample mean, μ₀ is the null hypothesis value, s is the sample standard deviation, and n is the sample size. This t-statistic measures how many standard errors the sample mean lies from the null value. Then find the p-value using the t-distribution with df = n − 1 degrees of freedom. For a two-sided test, p-value = 2 × P(T > |t|); for a one-sided test, use only one tail.
Make a Conclusion
Compare the p-value to the significance level α (commonly 0.05). If p-value ≤ α, reject H₀ and conclude that there is statistically significant evidence for Hₐ. If p-value > α, fail to reject H₀ — the data do not provide enough evidence against the null. Always state your conclusion in context: do not just say 'reject H₀'; say what that means for the actual situation being studied. Failing to reject H₀ does NOT prove H₀ is true; it only means the data are consistent with it.
The Key Equation
- \bar{x} — Sample mean (same as data): The arithmetic average of the n observed values in the sample.
- \mu_0 — Null hypothesis mean (same as data): The specific value of the population mean claimed by the null hypothesis H₀.
- s — Sample standard deviation (same as data): The standard deviation computed from the sample, used to estimate the unknown population standard deviation σ.
- n — Sample size (count (dimensionless)): The number of observations in the sample. Larger n produces a smaller standard error and a more powerful test.
- s/\sqrt{n} — Standard error (same as data): Estimates how much the sample mean x̄ varies from sample to sample due to chance.
Worked Example
Problem. A coffee shop claims its large cups contain an average of 16 oz of coffee. A consumer watchdog group suspects the cups are underfilled. They randomly sample n = 25 cups and measure: x̄ = 15.7 oz, s = 0.8 oz. At α = 0.05, is there convincing evidence the mean fill is less than 16 oz?
Answer. Reject H₀. There is convincing evidence the mean fill is less than 16 oz (t = −1.875, df = 24, p ≈ 0.037).
Origins · 1 minWilliam Sealy Gosset and how this was discovered
Gosset developed the t-distribution in 1908 while working as a statistician at the Guinness Brewery in Dublin. He needed a way to draw reliable conclusions from small samples of barley and hops. Since Guinness prohibited employees from publishing research, he published his groundbreaking paper under the pseudonym 'Student,' which is why the t-test is also called Student's t-test. His work made rigorous inference possible with small samples, revolutionizing experimental science. Gosset was so humble that he initially doubted the importance of his own discovery and needed Karl Pearson and Ronald Fisher to convince him it was genuinely useful — yet it became one of the most widely used statistical tools in history.
Related Concepts
- Confidence Intervals for Means — Confidence intervals and hypothesis tests are dual procedures: a two-sided t-test at level α rejects H₀ exactly when μ₀ falls outside the corresponding (1−α) confidence interval for μ.
- The t-Distribution — The t-test statistic follows a t-distribution with n−1 degrees of freedom. Understanding the shape and properties of this distribution is essential for finding p-values and critical values.
- P-Values and Statistical Significance — The p-value is the core decision-making tool in hypothesis testing; understanding what it means and how to interpret it correctly prevents common misconceptions.
- Two-Sample t-Tests — The natural extension of the one-sample t-test is comparing the means of two independent groups, such as testing whether a new medicine outperforms a placebo.