Table of contents
Upskilling Made Easy.
Types of Z-Test: One-Sample and Two-Sample Z-Test
Published 08 May 2025
1.5K+
5 sec read
In statistical analysis, the Z-test is a widely used hypothesis test that helps determine whether there is a significant difference between sample data and the population data. It is particularly useful when the sample size is large and the population standard deviation is known. In this blog, we will discuss two common types of Z-tests: One-Sample Z-Test and Two-Sample Z-Test. We will also cover the formulas for both tests along with examples to help you understand their applications.
A Z-test is a statistical test that uses the Z-distribution (a normal distribution) to determine whether there is a significant difference between a sample mean and a population mean, or between the means of two samples. It is typically used when:
There are two primary types of Z-tests:
A One-Sample Z-Test is used when you are comparing the sample mean to a known population mean. This test helps determine if there is enough statistical evidence to support the claim that the sample mean differs from the population mean.
The formula to calculate the Z-statistic for a one-sample Z-test is:
Z = (x̄ - μ) / (σ /sqrt(n))
Where:
State the Hypotheses:
Set the Significance Level (( alpha )): Commonly set at 0.05.
Calculate the Z-Statistic using the formula.
Compare the Z-Statistic to the critical Z-value (obtained from Z-tables based on ( alpha )).
Make a Decision: If the absolute value of the Z-statistic is greater than the critical value, reject the null hypothesis.
Suppose a manufacturer claims that the average weight of their product is 500 grams. You collect a random sample of 100 products and find that the sample mean weight is 505 grams, with a population standard deviation of 15 grams. You want to test at a 0.05 significance level whether the sample mean is significantly different from the claimed mean of 500 grams.
State the Hypotheses:
Calculate the Z-Statistic:
Z = (505 - 500) / 15 / sqrt(100) = 3.33
Determine the Critical Z-Value:
Decision:
Conclusion:
A Two-Sample Z-Test is used to compare the means of two independent samples to determine if there is a significant difference between them. This test is often used when you want to compare two groups (e.g., control group vs. experimental group) or two different treatments.
The formula for the two-sample Z-test is:
Z = (x̄_1 - x̄_2) / sqrt (σ_1^2 /n_1 + σ_2^2 /n_2)
Where:
State the Hypotheses:
Set the Significance Level (( alpha )): Typically set at 0.05.
Calculate the Z-Statistic using the formula.
Compare the Z-Statistic to the critical Z-value (using standard Z-tables).
Make a Decision: If the absolute value of the Z-statistic exceeds the critical value, reject the null hypothesis.
Suppose a researcher wants to compare the test scores of two different teaching methods. The following data is collected:
State the Hypotheses:
Calculate the Z-Statistic:
Z = (78 - 74) / sqrt (10^2 /40 + 12^2 / 50) = 1.72
Determine the Critical Z-Value:
Decision:
Conclusion:
In summary, both the One-Sample Z-Test and the Two-Sample Z-Test are used to compare sample data to a known population or between two sample groups. The One-Sample Z-Test is used when comparing the sample mean to a known population mean, while the Two-Sample Z-Test is used when comparing the means of two independent samples.
By understanding the formulas and the step-by-step procedures for these tests, you can confidently conduct hypothesis tests and draw meaningful conclusions from your data.
Happy testing!