\(t\)-Test for a
Mean
Learn how to test whether a population mean differs from a claimed value using the one-sample \(t\)-test: when to use it, how to compute the test statistic, and how to draw conclusions.
What Is Hypothesis Testing?
Hypothesis testing is a formal procedure for deciding whether sample data provide enough evidence to reject a claim about a population parameter. We start by assuming the claim is true, then ask: how surprising is our sample?
Why Use the \(t\)-Test?
When we test a claim about a population mean \(\mu\), we rarely know the true population standard deviation \(\sigma\). The \(t\)-test replaces \(\sigma\) with the sample standard deviation \(s\), and uses a heavier-tailed distribution to account for the extra uncertainty.
The \(t\)-Distribution vs. Normal
The Test Statistic
The one-sample \(t\)-statistic measures how far the sample mean is from the hypothesized mean, in units of the standard error:
Conditions for Validity
Before conducting a \(t\)-test, verify these three conditions:
\(z\)-Test vs. \(t\)-Test
| \(z\)-Test | \(t\)-Test | |
|---|---|---|
| Population \(\sigma\) | Known | Unknown |
| Estimate used | \(\sigma\) | \(s\) (sample SD) |
| Distribution | Standard Normal \(N(0,1)\) | \(t\) with \(df = n - 1\) |
| Tails | Thinner | Heavier (more conservative) |
| Common in practice? | Rare | Very common |
One-Tailed vs. Two-Tailed Tests
Evidence that the mean is less than claimed.
Evidence the mean differs from the claim in either direction.
Evidence that the mean is greater than claimed.
How to Conduct a \(t\)-Test
Example 1: Coffee Shop Wait Times
A coffee shop claims the average wait time is 5 minutes. A random sample of \(n = 20\) customers has \(\bar{x} = 5.8\) min and \(s = 1.5\) min. At \(\alpha = 0.05\), is there evidence the mean wait is longer than 5 minutes?
Visualizing the \(p\)-Value
Example 2: Battery Lifetime
A manufacturer claims batteries last 500 hours on average. An independent lab tests \(n = 36\) batteries: \(\bar{x} = 490\) hours, \(s = 30\) hours. At \(\alpha = 0.05\), is the true mean different from 500?
Example 3: Blood Pressure Drug
A drug is designed to lower systolic BP below the population norm of 120 mmHg. In a trial of \(n = 25\) patients: \(\bar{x} = 115\), \(s = 10\). Test at \(\alpha = 0.01\) whether the drug lowers the mean BP.
Interpreting the \(p\)-Value
The \(p\)-value is the probability of obtaining a test statistic at least as extreme as the observed one, assuming \(H_0\) is true.
Common Mistakes
Question 1 of 5
A researcher tests \(H_0\!: \mu = 100\) vs. \(H_a\!: \mu > 100\) with a sample of \(n = 16\). What are the degrees of freedom?
Question 2 of 5
Given \(\bar{x} = 52\), \(\mu_0 = 50\), \(s = 4\), and \(n = 25\), what is the value of the test statistic \(t\)?
Question 3 of 5
A two-tailed \(t\)-test yields a \(p\)-value of 0.03. At \(\alpha = 0.05\), what is the correct conclusion?
Question 4 of 5
Which condition is NOT required for a one-sample \(t\)-test?
Question 5 of 5
A sample of \(n = 9\) gives \(\bar{x} = 48\), \(s = 6\). Testing \(H_0\!: \mu = 50\) vs. \(H_a\!: \mu < 50\), what is the \(p\)-value (approximately)?