What is a Z-Test?
A Z-test is a location test used to evaluate claims about a population mean. The null hypothesis (H₀) states that the population mean μ equals a specific value μ₀. Depending on your research question, you can test whether the population mean differs from μ₀ (two-tailed), is less than μ₀ (left-tailed), or is greater than μ₀ (right-tailed).
The test works by converting your sample data into a standardized score called the Z-statistic, which tells you how many standard deviations your sample mean lies from the hypothesized population mean. This score is then compared against a reference distribution to determine the strength of evidence against H₀.
Z-Test Formula and Calculation
The Z-statistic is computed from your sample data and population parameters:
Z = (x̄ − μ₀) × √n / σ
x̄— Sample mean (average of your observations)μ₀— Hypothesized population mean (from the null hypothesis)n— Sample size (number of observations)σ— Population standard deviation (or sample SD if n ≥ 30)
When to Use a Z-Test
The Z-test is appropriate when:
- Small samples with known variance: Your data is normally distributed and you know the true population standard deviation.
- Large samples: Your sample contains at least 30 observations, even if the underlying distribution is not perfectly normal or you lack the exact population SD. The Central Limit Theorem ensures the sampling distribution of the mean is approximately normal.
If your sample is small (n < 30) and you do not know the population standard deviation, use the t-test instead, which accounts for additional uncertainty.
P-Values and Critical Regions
Two complementary approaches guide your decision to reject or retain H₀:
- P-value method: The p-value answers: if H₀ were true, how likely is my observed Z-statistic or something more extreme? A small p-value (typically ≤ 0.05) indicates strong evidence against H₀. For a two-tailed test, the p-value accounts for both tails of the distribution; for one-tailed tests, only the relevant tail is considered.
- Critical value method: You define a significance level α (e.g., 0.05) and identify critical boundaries on the Z distribution. If your Z-statistic falls within the critical region, you reject H₀. The critical regions are symmetric for two-tailed tests and one-sided for directional alternatives.
Common Pitfalls and Best Practices
Avoid these frequent mistakes when performing Z-tests:
- Confusing sample and population SD — Using the sample standard deviation with small samples invalidates the Z-test. Either use the known population SD, or switch to a t-test if you must estimate SD from your sample.
- Ignoring the normality assumption — The Z-test assumes normally distributed data, particularly for small samples. Extreme skewness or outliers can distort results. For non-normal data, consider transformation or non-parametric alternatives.
- Choosing the wrong tail direction — Ensure your alternative hypothesis matches your research question. A left-tailed test is not interchangeable with a right-tailed test; selecting the wrong direction halves your effective significance level and weakens power.
- Misinterpreting p-values — A p-value is not the probability that H₀ is true. It is the probability of observing your data (or more extreme) assuming H₀ holds. Nonsignificant results do not prove H₀ is correct; they simply lack sufficient evidence to reject it.