Z-Test
A Z-test is a statistical hypothesis test that uses the standard normal distribution (Z-distribution) to evaluate whether a sample mean (or difference of means) differs significantly from a hypothesized population value. It is most appropriate when the population standard deviation is known and the sample is large enough for the sampling distribution to be approximately normal.
Key assumptions
- Population standard deviation (σ) is known.
- Data are independent.
- Population is approximately normal, or sample size is large (commonly n ≥ 30) so the Central Limit Theorem applies.
- For two-sample tests, samples should have independent observations; equal variance may be assumed depending on the test formulation.
When to use a Z-test
- One-sample Z-test: test whether a sample mean differs from a known population mean.
- Two-sample Z-test: compare two means when both population standard deviations are known.
- Paired Z-test and other variants when conditions above hold.
If the population standard deviation is unknown or sample size is small, use a t-test instead.
Z-score and formulas
Basic Z-score for an individual value:
z = (x – μ) / σ
Explore More Resources
Z-statistic for a sample mean:
z = (x̄ – μ0) / (σ / √n)
Where:
* x̄ = sample mean
* μ0 = hypothesized population mean under H0
* σ = population standard deviation
* n = sample size
Two-sample (known σ1, σ2):
z = (x̄1 – x̄2) / √(σ1²/n1 + σ2²/n2)
Explore More Resources
Under the null hypothesis, the Z-statistic follows the standard normal distribution.
Hypothesis testing steps
- State hypotheses:
- Null (H0): parameter = hypothesized value (e.g., μ = μ0)
- Alternative (H1): parameter ≠, >, or < hypothesized value
- Choose significance level α (common choices: 0.05, 0.01).
- Compute z-statistic using the appropriate formula.
- Determine critical value(s) from the standard normal distribution (e.g., ±1.96 for two-tailed α = 0.05) or compute p-value.
- Decision:
- If |z| > z_critical (or p-value < α), reject H0.
- Otherwise, fail to reject H0.
- Report conclusion in context.
Example (one-sample, two-tailed)
Question: Is the average daily return of a stock different from 3%?
Explore More Resources
Given:
* n = 50, x̄ = 2% (0.02)
* μ0 = 3% (0.03)
* σ = 2.5% (0.025)
* α = 0.05 (two-tailed → critical z = ±1.96)
Compute:
z = (0.02 – 0.03) / (0.025 / √50) ≈ -2.83
Explore More Resources
Decision:
|z| = 2.83 > 1.96 → reject H0. Conclude the mean daily return is significantly different from 3% (in this case, significantly lower).
Central Limit Theorem (brief)
The Central Limit Theorem states that the sampling distribution of the sample mean approaches a normal distribution as sample size increases, regardless of the population distribution shape (provided samples are independent and identically distributed). This justifies using the Z-test for sufficiently large n even when the population distribution is not strictly normal.
Explore More Resources
Z-test vs T-test
- Z-test: assumes known population standard deviation and uses the normal distribution. Preferred for large samples or known σ.
- T-test: assumes unknown population standard deviation and uses the t-distribution, especially appropriate for smaller samples (n < 30).
Takeaways
- Use a Z-test when σ is known and the sampling distribution is approximately normal (large n or normal population).
- Compute the Z-statistic and compare to standard normal critical values or use the p-value method.
- If σ is unknown or sample size is small, switch to a t-test.