t-tests for a population mean
How do we test using the sample standard deviation when the population standard deviation is unknown?
Test settings
Try it
Testing a population mean: first check whether the population standard deviation is known
As with confidence intervals, the first step is to check whether the population variance is known, along with the sample size and distributional conditions, before applying a formula.
| Case | Statistic used | Coverage in this lesson |
|---|---|---|
| Population variance known | Z (using σ) | Covered in the previous lesson |
| Population variance unknown, large sample | Usually t; a Z approximation is possible with independent sampling, finite variance, a reliable normal approximation, and other required conditions | We can use t in this lesson |
| Population variance unknown, small sample | t (using s) | Main focus of this lesson |
Test settings
Try it
Why a t distribution rather than the standard normal distribution?
When σ is unknown, we calculate the standard error with the sample standard deviation s. Because s also comes from the sample, it introduces additional uncertainty. With small samples, the t distribution therefore usually has heavier tails than the standard normal distribution.
- Standard normal distribution
- t distribution
- Corresponding sample size
- 10
- Two-sided 5% t critical value
- 2.262
- Two-sided 5% Z critical value
- 1.960
Test settings
Try it
The sample mean slider changes only the sample mean. The sample size and standard deviation are held fixed so you can see how t changes with the data.
Write the original formula, then substitute the sample data
Consider battery life: the researcher asks whether the population mean life exceeds 10 hours. The population standard deviation is unknown. A random sample of 25 batteries from an approximately normal population gives a sample standard deviation s=1.5 hours.
H₀: μ ≤ 10
H₁: μ > 10
μ₀ = 10 h, s = 1.5 h, n = 25; population standard deviation unknown
Original formula: difference between the sample mean and hypothesized value ÷ standard error of the sample mean
How do we substitute the actual values?
- Standard error of the sample mean
- Numerical substitution
- Obtain the statistic and degrees of freedom
The sample mean slider changes only the sample mean. The sample size and standard deviation are held fixed so you can see how t changes with the data.
Test settings
Try it
The sample mean slider changes only the sample mean. The sample size and standard deviation are held fixed so you can see how t changes with the data.
What is the p-value for the sample result?
All three examples and their full hypotheses are retained. Switch examples, drag the sample mean, or choose α to check that the t value, tail area, and statistical conclusion agree.
H₀: μ ≤ 10
H₁: μ > 10
- t distribution
- Sample t position
- Critical value
- Tail area corresponding to the p-value
- Statistic t
- 2.000
- p-value (from the t distribution)
- 0.02847
- Significance level α
- 0.05
- Critical value
- 1.711
0.02847 ≤ 0.05. Decision: Reject H₀. The sample evidence meets the prespecified significance threshold.
Test settings
Try it
The sample mean slider changes only the sample mean. The sample size and standard deviation are held fixed so you can see how t changes with the data.
A complete hypothesis test: from research question to test conclusion
First choose a research question, then adjust the sample data and significance level to see how the critical-value and p-value methods reach the same decision.
H₀: μ ≤ 10
H₁: μ > 10
- t distribution
- Sample t position
- Critical value
- Tail area corresponding to the p-value
- Statistic t
- 2.000
- p-value (from the t distribution)
- 0.02847
- Significance level α
- 0.05
- Critical value
- 1.711
- Ask the question and state the hypothesesDoes mean battery life exceed 10 hours?
H₀: μ ≤ 10
H₁: μ > 10
- Calculate the statistic (formula, then substitution)
- Critical-value methodα=0.05, critical value 1.711; t=2.000, in the rejection region.
- p-value method0.02847 ≤ 0.05. Decision: Reject H₀. The sample evidence meets the prespecified significance threshold.
- Conclusion: Reject H₀. The sample result supports the direction of difference specified by the alternative hypothesis (it reaches statistical significance).