Overview
The z-test is used to test hypotheses about population means when the population standard deviation (σ) is known or the sample size is large.
Conditions
- Population σ is known (or n≥30 and use s)
- Random sample
- Population is normal OR n≥30 (by CLT)
Test Statistic
Z=σ/nxˉ−μ0
Where:
- xˉ = sample mean
- μ0 = hypothesized population mean
- σ = population standard deviation
- n = sample size
One-Sample Z-Test
Hypotheses
| Test Type | H0 | H1 |
|---|
| Two-tailed | μ=μ0 | μ=μ0 |
| Left-tailed | μ≥μ0 | μ<μ0 |
| Right-tailed | μ≤μ0 | μ>μ0 |
Critical Values
| α | Two-tailed | One-tailed |
|---|
| 0.10 | ±1.645 | 1.28 |
| 0.05 | ±1.96 | 1.645 |
| 0.01 | ±2.58 | 2.33 |
Two-Sample Z-Test
For Independent Samples
Z=n1σ12+n2σ22(xˉ1−xˉ2)−(μ1−μ2)0
Usually testing H0:μ1−μ2=0
Examples
Example 1: One-Sample Two-Tailed
A factory claims mean output is 500 units. Sample: n=64, xˉ=510, σ=40.
Test at α=0.05.
H0:μ=500,H1:μ=500
Z=40/64510−500=510=2.0
Critical values: ±1.96
∣2.0∣>1.96⇒Reject H0
p-value=2×P(Z>2.0)=2×0.0228=0.0456
Evidence supports μ=500.
Example 2: One-Sample Left-Tailed
Claim: μ<100. Sample: n=50, xˉ=97, σ=15. Test at α=0.05.
H0:μ≥100,H1:μ<100
Z=15/5097−100=2.12−3=−1.42
Critical value: −1.645
−1.42>−1.645⇒Fail to reject H0
Not enough evidence that μ<100.
Example 3: Two-Sample Test
Compare two populations:
- Group 1: n1=100, xˉ1=75, σ1=10
- Group 2: n2=100, xˉ2=72, σ2=12
Test H0:μ1=μ2 at α=0.05.
Z=100100+100144(75−72)−0=2.443=1.563=1.92
Critical values: ±1.96
∣1.92∣<1.96⇒Fail to reject H0
No significant difference between means.
Decision Summary
Using p-value
p≤α⇒Reject H0
p>α⇒Fail to reject H0
Using critical value
∣Z∣>zcritical⇒Reject H0(two-tailed)
Z>zcritical⇒Reject H0(right-tailed)
Z<−zcritical⇒Reject H0(left-tailed)
When to Use Z vs T
| Situation | Use |
|---|
| σ known | Z-test |
| σ unknown, n≥30 | Z or T (similar results) |
| σ unknown, n<30 | T-test |