# Two Sample Z Hypothesis Test

• /
• Blog
• /
• Two Sample Z Hypothesis Test

A two-sample z-test is a statistical test used to compare the means of two different samples to determine if there is a significant difference between them. It is based on the assumption that both samples are drawn from normally distributed populations with equal variances.

## Steps in Two Sample Z Test

To conduct a two-sample z-test, the following steps are typically followed:

1. Specify the null and alternative hypotheses. The null hypothesis is usually that the means of the two samples are equal, while the alternative hypothesis is that the means are not equal.
2. Collect and summarize the data for both samples. Calculate the sample means and standard deviations for each sample.
3. Calculate the test statistic, which is the difference between the two sample means, divided by the standard error of the mean.
4. Determine the critical value of the test statistic based on the significance level (alpha) of the test.
5. Compare the calculated test statistic to the critical value to determine whether to reject or fail to reject the null hypothesis. If the calculated test statistic exceeds the critical value, the null hypothesis is rejected, and the alternative hypothesis is accepted.

## Conditions for Z Test

To conduct a valid two-sample z-test, the following conditions must be met:

1. Both samples must be drawn randomly from their respective populations.
2. Each observation in each sample must be independent of the others.
1. The sampling must be done with replacement, OR
2. If sampling without replacement, the sample size must be less than 10% of the population.
3. The populations must approximate a normal distribution.
4. The population standard deviations must be known, or each sample size must be large (30 or more).

## Typical Null and Alternate Hypotheses in Two-Sample Z Test

a) Two Tail Test:

In a two-sample z-test, the null hypothesis is that there is no difference between the means of the two samples. This can be expressed as:

H0: μ1 = μ2

where μ1 is the mean of the first sample and μ2 is the mean of the second sample.

The alternate hypothesis is the opposite of the null hypothesis and is that there is a difference between the means of the two samples. This can be expressed as:

Ha: μ1 ≠ μ2

b) Left Tail Test:

A left-tailed hypothesis is one in which the mean of the first sample is less than the mean of the second sample. This can be expressed as:

H0: μ1 >= μ2

Ha: μ1 < μ2

c) Right Tail Test:

A right-tailed hypothesis is one in which the mean of the first sample is greater than the mean of the second sample. This can be expressed as:

H0: μ1 <= μ2

Ha: μ1 > μ2

## Calculating Test Statistic

The z-score represents the number of standard deviations that the difference between the two sample means is from zero. It is used to determine whether the difference between the two sample means is statistically significant.

The formula for calculating the z-score in a two-sample z-test is as follows:

$$\LARGE{z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}}$$

where $$\bar{x}_1$$ and $$\bar{x}_2$$ are the sample means, $$\sigma_1^2$$ and $$\sigma_2^2$$ are the sample variances, and $$n_1$$ and $$n_2$$ are the sample sizes. ## Typical Critical Values

The critical values for the z-score in a two-sample z-test depend on whether the test is a one-tail or two-tail test.

For a one-tail test, the critical value is determined based on the tail of the distribution in which the alternative hypothesis is located. For example, if the alternative hypothesis is that the mean of the first sample is greater than the mean of the second sample, the critical value would be the value that corresponds to the upper tail of the distribution.

For a two-tail test, the critical value is determined based on the significance level of the test and the total area of both tails of the distribution. For example, if the significance level is 0.05 and the test is two-tailed, the critical value would be the value that corresponds to an area of 0.05 in both tails of the distribution (or 0.025 area in one tail, as the normal distribution is symmetric).

The most common critical values for the z-score in a two-sample z-test are as follows:

• For a two-tail test with a significance level of 0.05, the critical value is 1.64.
• For a two-tail test with a significance level of 0.01, the critical value is 2.33.
• For a two-tail test with a significance level of 0.001, the critical value is 3.09.
• For a two-tail test with a significance level of 0.05, the critical value is 1.96.
• For a two-tail test with a significance level of 0.01, the critical value is 2.58.
• For a two-tail test with a significance level of 0.001, the critical value is 3.29.

These critical values are based on the standard normal distribution and are used to determine whether the calculated z-score is statistically significant. If the calculated z-score is greater than the critical value, the null hypothesis is rejected, and the alternative hypothesis is accepted.

You can find the critical values using a Normal Distribution table or software such as Excel. The formula to find out this value in Excel is =NORM.S.INV(alpha) for the one-tail test and =NORM.S.INV(alpha/2) for the two-tail test. This provides the critical z value for the left tail.

 (adsbygoogle = window.adsbygoogle || []).push({}); 
###### About the Author Quality Gurus

Customers served! 1

Quality Management Course

FREE! Subscribe to get 52 weekly lessons. Every week you get an email that explains a quality concept, provides you with the study resources, test quizzes, tips and special discounts on our other e-learning courses.

 (adsbygoogle = window.adsbygoogle || []).push({}); 

Similar Posts:

May 20, 2018

## ASQ® CQE Exam Preparation Quiz

ASQ® CQE Exam Preparation Quiz

January 21, 2018

## ASQ® CSSBB  | How to pass your Six Sigma Black Belt Exam?

ASQ® CSSBB  | How to pass your Six Sigma Black Belt Exam?

June 8, 2022

## ASQ® CSSGB Body of Knowledge 2022 – What is New?

ASQ® CSSGB Body of Knowledge 2022 – What is New?

December 7, 2022

## Lean Six Sigma Interview Questions: Part 2: White and Yellow Belt Level

Lean Six Sigma Interview Questions: Part 2: White and Yellow Belt Level

December 24, 2021

## Seven Quality Tools – Pareto Chart

Seven Quality Tools – Pareto Chart

March 3, 2022

## The Power Of Nature: Biomimicry

The Power Of Nature: Biomimicry

December 18, 2022

## Quantile (Quartile, Decile and Percentile): Manual Calculation + Microsoft Excel

Quantile (Quartile, Decile and Percentile): Manual Calculation + Microsoft Excel

December 19, 2022

## What is Hypothesis Testing?

What is Hypothesis Testing?

June 9, 2022

## ASQ® CSSBB Body of Knowledge 2022 – What is New?

ASQ® CSSBB Body of Knowledge 2022 – What is New?

32 Courses on SALE!