01 / 20
t

\(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.

College Statistics

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?

\(H_0\) : Null Hypothesis
The default claim: the population mean equals a specific value.
\(H_a\) : Alternative Hypothesis
What we suspect instead: the mean is different, larger, or smaller.

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.

Small Samples
Works even with \(n < 30\), provided the population is roughly normal.
Unknown \(\sigma\)
Uses \(s\) instead: realistic for almost every real-world scenario.
Heavier Tails
The \(t\)-distribution has more probability in the tails than the normal, making the test more conservative.

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:

\(\bar{x}\)
Sample mean
\(\mu_0\)
Hypothesized population mean
\(s\)
Sample standard deviation
\(n\)
Sample size

Conditions for Validity

Before conducting a \(t\)-test, verify these three conditions:

1
Random Sample: Data must come from a random sample or randomized experiment.
2
Independence: Observations are independent. If sampling without replacement, \(n\) must be < 10% of the population (\(10\%\) rule).
3
Normality: The sampling distribution of \(\bar{x}\) is approximately normal. Met if the population is normal, or \(n \geq 30\) (CLT), or the data show no strong skew/outliers.

\(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

Left-Tailed
\(H_a\!: \mu < \mu_0\)
Evidence that the mean is less than claimed.
Two-Tailed
\(H_a\!: \mu \neq \mu_0\)
Evidence the mean differs from the claim in either direction.
Right-Tailed
\(H_a\!: \mu > \mu_0\)
Evidence that the mean is greater than claimed.

How to Conduct a \(t\)-Test

1
State hypotheses: Write \(H_0\!: \mu = \mu_0\) and choose \(H_a\) (left, right, or two-tailed).
2
Check conditions: Random, Independent, Normal (or \(n \geq 30\)).
3
Compute the test statistic: \(\displaystyle t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}\) with \(df = n - 1\).
4
Find the \(p\)-value: Use the \(t\)-table or technology for your tail direction.
5
Conclude: If \(p\text{-value} \leq \alpha\), reject \(H_0\). Otherwise, fail to reject.

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.

✓
Small \(p\)-value (\(\leq \alpha\)): The data are unlikely under \(H_0\). Reject \(H_0\).
✕
Large \(p\)-value (\(> \alpha\)): The data are plausible under \(H_0\). Fail to reject \(H_0\).

Common Mistakes

✕ Using \(z\) instead of \(t\)
When \(\sigma\) is unknown, you must use \(s\) and the \(t\)-distribution, not \(z\).
✕ Wrong tail direction
A two-tailed test doubles the one-tail \(p\)-value. Forgetting this changes the conclusion.
✕ "Accept \(H_0\)"
We say "fail to reject \(H_0\)," never "accept \(H_0\)." Absence of evidence is not evidence of absence.

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)?