intermediate 22 minutes

One-Sample Tests

Learn to perform one-sample hypothesis tests. Master z-tests, t-tests, and proportion tests for single populations.

On This Page
Advertisement

One-Sample Tests Overview

A one-sample test compares a sample statistic to a hypothesized population value.

SituationTest
Mean, σ knownz-test for mean
Mean, σ unknownOne-sample t-test
Proportionz-test for proportion

One-Sample z-Test for Means

Use when testing a population mean with known population standard deviation σ.

z-Test Statistic

z=xˉμ0σ/nz = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}

Where:

  • x̄ = sample mean
  • μ₀ = hypothesized population mean
  • σ = known population standard deviation
  • n = sample size
z-Test for Mean

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: z=498.55003/36=1.50.5=3.0z = \frac{498.5 - 500}{3 / \sqrt{36}} = \frac{-1.5}{0.5} = -3.0

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.

One-Sample t-Test

t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}

df = n - 1

Where s is the sample standard deviation.

Steps for One-Sample t-Test

  1. State hypotheses (H₀ and H₁)
  2. Check conditions
  3. Calculate t-statistic
  4. Find p-value or compare to critical value
  5. Make decision and state conclusion
One-Sample t-Test

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: t=28.3256.2/20=3.31.386=2.38t = \frac{28.3 - 25}{6.2 / \sqrt{20}} = \frac{3.3}{1.386} = 2.38

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

Left-Tailed Test

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

t=8.5103.2/25=1.50.64=2.34t = \frac{8.5 - 10}{3.2 / \sqrt{25}} = \frac{-1.5}{0.64} = -2.34

df = 24, critical t (α = 0.05, left-tailed) = -1.711

Since -2.34 < -1.711, reject H₀. Evidence supports that μ < 10.

Right-Tailed Test

Claim: Average salary exceeds $50,000

H₀: μ ≤ 50,000 (or μ = 50,000) H₁: μ > 50,000

Sample: n = 40, x̄ = 52,500, s = 8,000

t=52500500008000/40=25001265=1.98t = \frac{52500 - 50000}{8000 / \sqrt{40}} = \frac{2500}{1265} = 1.98

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.

z-Test for Proportion

z=p^p0p0(1p0)nz = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}

Where:

  • p̂ = sample proportion = X/n
  • p₀ = hypothesized proportion
  • n = sample size

Conditions for Proportion Test

z-Test for Proportion

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: z=0.380.300.30(0.70)200=0.080.00105=0.080.0324=2.47z = \frac{0.38 - 0.30}{\sqrt{\frac{0.30(0.70)}{200}}} = \frac{0.08}{\sqrt{0.00105}} = \frac{0.08}{0.0324} = 2.47

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.

Two-Tailed Proportion Test

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: z=0.5750.500.50(0.50)200=0.0750.0354=2.12z = \frac{0.575 - 0.50}{\sqrt{\frac{0.50(0.50)}{200}}} = \frac{0.075}{0.0354} = 2.12

Critical values: ±1.96

Decision: Since 2.12 > 1.96, reject H₀

Conclusion: Evidence suggests the coin is not fair.


Choosing the Right Test

SituationParameterTestFormula
Mean, σ knownμz-testz = (x̄ - μ₀)/(σ/√n)
Mean, σ unknownμt-testt = (x̄ - μ₀)/(s/√n)
Proportionpz-testz = (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:

Advertisement

Was this lesson helpful?

Help us improve by sharing your feedback or spreading the word.