What is a two sample Z-test and how is it calculated and applied in a real-life scenario?

What is a two sample Z-test and how is it calculated and applied in a real-life scenario?

A two-sample Z-test is a statistical method used to compare the means of two different groups or populations. It is commonly used to determine whether there is a significant difference between the means of two datasets.

To calculate a two-sample Z-test, first, the sample means of each group are calculated. Then, the standard error of the difference between the means is determined. This is followed by calculating the Z-score, which measures the difference between the two sample means in terms of standard deviations. Finally, the Z-score is compared to a critical value from a Z-table to determine whether the difference between the means is statistically significant.

In a real-life scenario, a two-sample Z-test can be applied in various situations such as comparing the effectiveness of two different medications, determining if there is a difference in average income between two job positions, or evaluating the impact of a new marketing strategy on sales. This test allows researchers to make informed decisions and draw conclusions based on statistical evidence.

Two Sample Z-Test: Definition, Formula, and Example


two sample z-test is used to test whether two population means are equal.

This test assumes that the standard deviation of each population is known.

This tutorial explains the following:

  • The formula to perform a two sample z-test.
  • The assumptions of a two sample z-test.
  • An example of how to perform a two sample z-test.

Let’s jump in!

Two Sample Z-Test: Formula

A two sample z-test uses the following null and alternative hypotheses:

  • H0μ1 = μ2 (the two population means are equal)
  • HAμ1 ≠ μ2 (the two population means are not equal)

We use the following formula to calculate the z test statistic:

z = (x1x2) / √σ12/n1 + σ22/n2)

where:

  • x1, x2: sample means
  • σ1, σ2: population standard deviations
  • n1, n2: sample sizes

If the p-value that corresponds to the z test statistic is less than your chosen significance level (common choices are 0.10, 0.05, and 0.01) then you can .

Two Sample Z-Test: Assumptions

For the results of a two sample z-test to be valid, the following assumptions should be met:

  • The data from each population are continuous (not discrete).
  • Each sample is a from the population of interest.
  • The data in each population is approximately .
  • The population standard deviations are known.

Two Sample Z-Test: Example

A scientist wants to know if the mean IQ level between individuals in city A and city B are different, so she selects a simple random sample of  20 individuals from each city and records their IQ levels.

To test this, she will perform a two sample z-test at significance level α = 0.05 using the following steps:

Step 1: Gather the sample data.

Suppose she collects two simple random samples with the following information:

  •  x1 (sample 1 mean IQ) = 100.65
  • n1 (sample 1 size) = 20
  • x2 (sample 2 mean IQ) = 108.8
  • n2 (sample 2 size) = 20

Step 2: Define the hypotheses.

She will perform the two sample z-test with the following hypotheses:

  • H0μ1 = μ2 (the two population means are equal)
  • HAμ1 ≠ μ2 (the two population means are not equal)

Step 3: Calculate the z test statistic.

The z test statistic is calculated as:

  • z = (x1x2) / √σ12/n1 + σ22/n2)
  • z = (100.65-108.8) / √152/20 + 152/20)
  • z = -1.718

Step 4: Calculate the p-value of the z test statistic.

According to the , the two-tailed p-value associated with z = -1.718 is 0.0858.

Step 5: Draw a conclusion.

Since the p-value (0.0858) is not less than the significance level (.05), the scientist will fail to reject the null hypothesis.

There is not sufficient evidence to say that the mean IQ level is different between the two populations.

Note: You can also perform this entire two sample z-test by using the .

The following tutorials explain how to perform a two sample z-test using different statistical software:

Cite this article

stats writer (2024). What is a two sample Z-test and how is it calculated and applied in a real-life scenario?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/what-is-a-two-sample-z-test-and-how-is-it-calculated-and-applied-in-a-real-life-scenario/

stats writer. "What is a two sample Z-test and how is it calculated and applied in a real-life scenario?." PSYCHOLOGICAL SCALES, 27 Jun. 2024, https://scales.arabpsychology.com/stats/what-is-a-two-sample-z-test-and-how-is-it-calculated-and-applied-in-a-real-life-scenario/.

stats writer. "What is a two sample Z-test and how is it calculated and applied in a real-life scenario?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/what-is-a-two-sample-z-test-and-how-is-it-calculated-and-applied-in-a-real-life-scenario/.

stats writer (2024) 'What is a two sample Z-test and how is it calculated and applied in a real-life scenario?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/what-is-a-two-sample-z-test-and-how-is-it-calculated-and-applied-in-a-real-life-scenario/.

[1] stats writer, "What is a two sample Z-test and how is it calculated and applied in a real-life scenario?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. What is a two sample Z-test and how is it calculated and applied in a real-life scenario?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top