One-Sample Tests
Learn to perform one-sample hypothesis tests. Master z-tests, t-tests, and proportion tests for single populations.
On This Page
One-Sample Tests Overview
A one-sample test compares a sample statistic to a hypothesized population value.
| Situation | Test |
|---|---|
| Mean, σ known | z-test for mean |
| Mean, σ unknown | One-sample t-test |
| Proportion | z-test for proportion |
One-Sample z-Test for Means
Use when testing a population mean with known population standard deviation σ.
Where:
- x̄ = sample mean
- μ₀ = hypothesized population mean
- σ = known population standard deviation
- n = sample size
Claim: A machine fills bottles with exactly 500 mL
Given:
- Sample: n = 36, x̄ = 498.5 mL
- Population σ = 3 mL (from machine specifications)
- α = 0.05, two-tailed
Hypotheses:
- H₀: μ = 500
- H₁: μ ≠ 500
Solution:
Critical values: ±1.96 p-value: 2 × P(Z < -3.0) = 2 × 0.0013 = 0.0026
Decision: Since |−3.0| > 1.96 (or p = 0.0026 < 0.05), reject H₀
Conclusion: Evidence suggests the mean fill is not 500 mL.
One-Sample t-Test
Use when testing a population mean with unknown population standard deviation.
df = n - 1
Where s is the sample standard deviation.
Steps for One-Sample t-Test
- State hypotheses (H₀ and H₁)
- Check conditions
- Calculate t-statistic
- Find p-value or compare to critical value
- Make decision and state conclusion
Question: Is the average commute time different from 25 minutes?
Sample data: n = 20, x̄ = 28.3 min, s = 6.2 min α = 0.05, two-tailed
Hypotheses:
- H₀: μ = 25
- H₁: μ ≠ 25
Conditions:
- Random sample ✓
- n = 20 (check for approximate normality)
Test statistic:
df = 19, critical t = ±2.093
p-value (two-tailed) ≈ 0.028
Decision: Since 2.38 > 2.093 (or p = 0.028 < 0.05), reject H₀
Conclusion: Evidence suggests average commute time ≠ 25 minutes.
One-Tailed t-Tests
Claim: New method reduces average processing time below 10 minutes
H₀: μ ≥ 10 (or μ = 10) H₁: μ < 10
Sample: n = 25, x̄ = 8.5, s = 3.2
df = 24, critical t (α = 0.05, left-tailed) = -1.711
Since -2.34 < -1.711, reject H₀. Evidence supports that μ < 10.
Claim: Average salary exceeds $50,000
H₀: μ ≤ 50,000 (or μ = 50,000) H₁: μ > 50,000
Sample: n = 40, x̄ = 52,500, s = 8,000
df = 39, critical t (α = 0.05, right-tailed) ≈ 1.685
Since 1.98 > 1.685, reject H₀. Evidence suggests μ > $50,000.
One-Sample z-Test for Proportions
Use when testing a population proportion.
Where:
- p̂ = sample proportion = X/n
- p₀ = hypothesized proportion
- n = sample size
Conditions for Proportion Test
Claim: More than 30% of customers prefer online shopping
Sample: n = 200, 76 prefer online (p̂ = 0.38) α = 0.05, right-tailed
Hypotheses:
- H₀: p ≤ 0.30 (or p = 0.30)
- H₁: p > 0.30
Check conditions:
- np₀ = 200(0.30) = 60 ≥ 10 ✓
- n(1-p₀) = 200(0.70) = 140 ≥ 10 ✓
Test statistic:
Critical value (right-tailed, α = 0.05): z = 1.645 p-value: P(Z > 2.47) = 0.0068
Decision: Since 2.47 > 1.645 (or p = 0.0068 < 0.05), reject H₀
Conclusion: Evidence supports that more than 30% prefer online shopping.
Claim: The coin is fair (p = 0.5)
Sample: 200 flips, 115 heads (p̂ = 0.575) α = 0.05, two-tailed
Hypotheses:
- H₀: p = 0.50
- H₁: p ≠ 0.50
Test statistic:
Critical values: ±1.96
Decision: Since 2.12 > 1.96, reject H₀
Conclusion: Evidence suggests the coin is not fair.
Choosing the Right Test
| Situation | Parameter | Test | Formula |
|---|---|---|---|
| Mean, σ known | μ | z-test | z = (x̄ - μ₀)/(σ/√n) |
| Mean, σ unknown | μ | t-test | t = (x̄ - μ₀)/(s/√n) |
| Proportion | p | z-test | z = (p̂ - p₀)/√[p₀(1-p₀)/n] |
Common Mistakes
Summary
In this lesson, you learned:
- z-test for mean (σ known): z = (x̄ - μ₀)/(σ/√n)
- One-sample t-test (σ unknown): t = (x̄ - μ₀)/(s/√n), df = n-1
- z-test for proportion: z = (p̂ - p₀)/√[p₀(1-p₀)/n]
- Check conditions: Random sample, normality/sample size
- Compare test statistic to critical value OR use p-value
- State conclusions in context
Practice Problems
1. A coffee company claims their bags contain 500g. A sample of 25 bags has mean = 498g, s = 5g. Test at α = 0.05 (two-tailed).
2. A factory claims < 5% defective items. Sample of 300 finds 21 defective. Test at α = 0.05.
3. Historical data shows μ = 100, σ = 15. A new sample of 50 has mean = 104. Is this significantly different at α = 0.01?
4. What’s the difference between using the z-test and t-test for means?
Click to see answers
1. One-sample t-test (σ unknown)
H₀: μ = 500, H₁: μ ≠ 500
t = (498 - 500)/(5/√25) = -2/1 = -2.0
df = 24, critical t (α = 0.05, two-tailed) = ±2.064
Since |-2.0| < 2.064, fail to reject H₀
Not enough evidence that mean ≠ 500g.
2. z-test for proportion
p̂ = 21/300 = 0.07 H₀: p ≥ 0.05, H₁: p < 0.05
Wait—sample proportion (0.07) is HIGHER than claimed (0.05). This contradicts H₁: p < 0.05!
z = (0.07 - 0.05)/√[0.05(0.95)/300] = 0.02/0.0126 = 1.59
Since z is positive (wrong direction for left-tailed test), fail to reject H₀
No evidence that defect rate is less than 5%.
3. z-test for mean (σ known)
H₀: μ = 100, H₁: μ ≠ 100
z = (104 - 100)/(15/√50) = 4/2.12 = 1.89
Critical z (α = 0.01, two-tailed) = ±2.576
Since |1.89| < 2.576, fail to reject H₀ at α = 0.01
Not significant at the 0.01 level.
4. Key difference:
- z-test: Used when population σ is known (rare)
- t-test: Used when σ is unknown and estimated by s (common)
The t-test uses the t-distribution which has heavier tails, accounting for the additional uncertainty from estimating σ. The t-test is almost always the appropriate choice for testing means.
Next Steps
Continue with hypothesis testing:
- Two-Sample Tests - Comparing two groups
- T-Test Calculator - Practice calculations
- ANOVA - Compare multiple groups
Was this lesson helpful?
Help us improve by sharing your feedback or spreading the word.