Topic - When the sample size is large (n≥30), the Central Limit Theorem guarantees that the sampling distribution of the sample mean follows a normal distribution. In this regime, the Z-test provides the standard analytical tool to test hypotheses regarding single population means and differences between two independent population means.
To ensure that inference using the standard normal distribution is valid, the following conditions must be satisfied:
Continuous Data: The metric of interest must be continuous numerical data.
Simple Random Sampling: Observations are independent and identically distributed (i.i.d.).
Large Sample Size (n≥30): By the Central Limit Theorem, the distribution of Xˉ is normal. If the population standard deviation σ is unknown, we substitute the sample standard deviation s without needing Student's t-distribution.
Normality Verification: For moderate samples, normality of the data can be validated using the Shapiro-Wilk test (scipy.stats.shapiro).
Problem: A car manufacturer claims the mileage of their new car is μ=25 km/L with σ=2.5 km/L. A sample of n=45 cars gives a mean of Xˉ=24 km/L. Is there evidence to claim that the mean mileage differs from 25 km/L? Use α=0.01.
Calculate Test Statistic:Zcalc=σ/nXˉ−μ0=2.5/4524−25=2.5/6.708−1=0.3727−1≈−2.683
Method A (Critical Value):
For α=0.01, zα/2=z0.005=2.575.
Since ∣Zcalc∣=∣−2.683∣=2.683>2.575, we Reject H0.
Method B (P-Value):p=2⋅P(Z<−2.683)=2⋅0.00366=0.0073
Since p-value=0.0073<0.01, we Reject H0.
Method C (Confidence Interval):CI99%=24±2.575⋅0.3727=24±0.960=[23.04,24.96]
Since hypothesized mean μ0=25 does not lie within [23.04,24.96], we Reject H0.
Conclusion: There is statistically significant evidence at α=0.01 to conclude the mean mileage is different from 25 km/L.
Scenario 2: Left-Tailed Test (PVC Pipe Thickness)
Problem: A sample of n=900 PVC pipes has a mean thickness of Xˉ=12.5 mm. Test whether the sample comes from a population with mean μ≥13 mm against the claim that it is less than 13 mm, given σ=1 mm at α=0.05.
Calculate Test Statistic:Zcalc=σ/nXˉ−μ0=1/90012.5−13=1/30−0.5=−0.5⋅30=−15.0
Decision:
Critical value for left-tailed test at α=0.05 is −z0.05=−1.645.
Since Zcalc=−15.0<−1.645 (and p-value≈0.000), we Reject H0.
Conclusion: Significant evidence indicates average thickness is less than 13 mm.
Scenario 3: Right-Tailed Test (Food Delivery Time)
Problem: An e-commerce food app claims delivery time is at most 60 minutes (μ≤60) with σ=30 minutes. A sample of n=45 orders yields a mean of Xˉ=75 minutes. Test the claim at α=0.05.
Calculate Test Statistic:Zcalc=σ/nXˉ−μ0=30/4575−60=4.47215≈+3.35
Decision:
Critical value for right-tailed test at α=0.05 is +z0.05=+1.645.
p-value=P(Z>3.35)=0.0004.
Since p-value<0.05 and Zcalc>1.645, we Reject H0.
Conclusion: Strong evidence that the mean delivery time exceeds 60 minutes.
Calculate Test Statistic:SEdiff=n1s12+n2s22=1604.12+1803.52=16016.81+18012.25=0.1051+0.0681=0.1732≈0.4161Zcalc=SEdiffXˉ1−Xˉ2=0.416113−15=0.4161−2≈−4.807
Decision:
Critical value at α=0.01 is z0.005=2.575.
Since ∣Zcalc∣=∣−4.807∣=4.807>2.575 (and p-value<0.0001), we Reject H0.
Conclusion: There is strong empirical evidence that average hemoglobin levels differ significantly between men and women.
Z-Test Criterion: Appropriate whenever n≥30 due to asymptotic normality from the Central Limit Theorem.
Three Equivalent Paths: For two-tailed tests, Critical Value (∣Z∣>zα/2), P-value (p≤α), and Confidence Interval (μ0∈/CI) always agree.
Two-Sample Variance Pooling: If variances are unknown but sample sizes are large (n1,n2≥30), substituting individual sample variances s12 and s22 is asymptotically exact.