Statistics Universe

Statistics Universe

Two Sample Z-Test Calculator

Loading calculator...

Two Sample Z-Test Procedure

Step 1: Define the Null and Alternative Hypotheses.

The formulation of these hypotheses depends on the direction of the test: left-tailed, right-tailed, or two-tailed. Below are the null and alternative hypotheses for each case:

  • Left-tailed Test:
    • Null Hypothesis (H0): The difference between the population means is equal to the hypothesized value.
      $$ H_0: \mu_1 - \mu_2 = \mu_0 $$
    • Alternative Hypothesis (Ha): The difference between the population means is less than the hypothesized value.
      $$ H_a: \mu_1 - \mu_2 < \mu_0 $$
  • Right-tailed Test:
    • Null Hypothesis (H0): The difference between the population means is equal to the hypothesized value.
      $$ H_0: \mu_1 - \mu_2 = \mu_0 $$
    • Alternative Hypothesis (Ha): The difference between the population means is greater than the hypothesized value.
      $$ H_a: \mu_1 - \mu_2 > \mu_0 $$
  • Two-tailed Test:
    • Null Hypothesis (H0): The difference between the population means is equal to the hypothesized value.
      $$ H_0: \mu_1 - \mu_2 = \mu_0 $$
    • Alternative Hypothesis (Ha): The difference between the population means is not equal to the hypothesized value.
      $$ H_a: \mu_1 - \mu_2 \neq \mu_0 $$

Step 2: Calculate the Z-Test Statistic

Use the formula below to compute the z-statistic:

$$ Z_{stat} = \frac{(\bar{X}_1 - \bar{X}_2) - \mu_0}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}, \text{ where:} $$

  • \( \bar{X}_1 \) is the sample mean of the first sample
  • \( \bar{X}_2 \) is the sample mean of the second sample
  • \( \mu_0 \) is the hypothesized difference between the population means
  • \( \sigma_1 \) and \( \sigma_2 \) are the population standard deviations of the two samples
  • \( n_1 \) and \( n_2 \) are the sample sizes of the two samples

Step 3: Determine the P-Value

Find the p-value based on the type of test:

  • Left-tailed: $$ p-value = P(z < z_{\text{stat}}) $$
  • Right-tailed: $$ p-value = P(z > z_{\text{stat}}) $$
  • Two-tailed: $$ p-value = 2 \times P(z > |z_{\text{stat}}|) $$

Step 4: Make a Decision

Compare the p-value to your chosen significance level, \( \alpha \):

  • If \( p \leq \alpha \): Reject the null hypothesis.
  • If \( p > \alpha \): Do not reject the null hypothesis.

Step 5: Draw a Conclusion

Based on your decision:

  • Reject \( H_0 \): There is significant evidence to support the alternative hypothesis.
  • Fail to reject \( H_0 \): There is no significant evidence to support the alternative hypothesis.
Scroll to Top