Calculate Independent Two-Sample Z-Test

Enter sample mean, population SD (σ), and sample size for Group 1 and Group 2.

Sample 1 mean (e.g. 82).
Population 1 SD $\sigma_1$.
Sample 1 count $n_1$.
Sample 2 mean (e.g. 75).
Population 2 SD $\sigma_2$.
Sample 2 count $n_2$.

Calculation Results

Primary Metric Output --
Metric Breakdown 1--
Metric Breakdown 2--
Metric Breakdown 3--
Metric Breakdown 4--
Metric Breakdown 5--
Mathematical Standard--

Calculated using Two-Sample Z-test equations: Z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}

*Note: The Two-Sample Z-test tests whether two independent population means differ when population SDs σ1 and σ2 are known.

Quick Summary

The Two Sample Z Test Calculator evaluates independent group mean differences ($\bar{x}_1 - \bar{x}_2$), two-sample $Z$-statistic, $p$-values, and 95% confidence intervals.

Formula Explanation

Z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}
\text{95\% CI} = (\bar{x}_1 - \bar{x}_2) \pm 1.96 \cdot \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}

How It Works

An independent 2-sample Z-test compares two distinct population means when population standard deviations $\sigma_1$ and $\sigma_2$ are known. The Two Sample Z Test Calculator evaluates standard error of difference $\text{SE}_{\text{diff}} = \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}$ and $Z$-statistic.

Step-by-Step Worked Example

Practical Problem: Group 1 ($n_1 = 40, \bar{x}_1 = 82, \sigma_1 = 10$) vs Group 2 ($n_2 = 40, \bar{x}_2 = 75, \sigma_2 = 12$). Calculate $Z$-statistic and test for significant difference ($\alpha = 0.05$).

  1. Step 1: Calculate mean difference ($\bar{x}_1 - \bar{x}_2$): $82 - 75 = \mathbf{+7.0000}$.
  2. Step 2: Calculate variance ratios ($\sigma_1^2/n_1$ and $\sigma_2^2/n_2$): $100/40 = 2.50$; $144/40 = 3.60$.
  3. Step 3: Calculate standard error of difference ($\text{SE}_{\text{diff}}$): $\sqrt{2.50 + 3.60} = \sqrt{6.10} = \mathbf{2.4698}$.
  4. Step 4: Divide mean difference by $\text{SE}_{\text{diff}}$: $Z = 7.0 / 2.4698 = \mathbf{+2.8342}$.
  5. Step 5: Calculate two-tailed p-value: $p = 2 \times (1 - \Phi(2.8342)) = \mathbf{0.0046}$ (Reject $H_0$ at 5% significance level).

Real-World Calculation Examples

Scenario 1: Test Scores (x̄1 = 82, x̄2 = 75, n = 40)

Parameters: Group 1 vs Group 2
Result: Z = +2.8342, p = 0.0046 (Statistically significant).

Scenario 2: Factory A vs Factory B Output Weight

Parameters: Factory A (x̄1 = 500g, σ1 = 5g) vs Factory B (x̄2 = 498g, σ2 = 6g)
Result: Significant weight difference.

Scenario 3: National Exam Regional Scores

Parameters: Region 1 vs Region 2 large sample Z-test
Result: 2-sample Z-test evaluation.

Scenario 4: Large Sample Medical Trial (n1 = n2 = 500)

Parameters: Large sample Z-test comparison
Result: Standard normal Z-test.

Key Benefits of Using This Calculator

Known Population SDs ($\sigma_1, \sigma_2$)

Calculates exact two-sample Z-test when population standard deviations are known.

95% CI of Difference

Outputs 95% confidence interval for mean difference $(\bar{x}_1 - \bar{x}_2)$.

Large Sample Precision

Leverages Central Limit Theorem for large sample inferential testing.

100% Free & Client-Side

Executes locally in your browser with zero latency or web server transmission.

Frequently Asked Questions (FAQ)

What is a Two-Sample Z-test?

A Two-Sample Z-test checks whether the difference between two independent sample means $\bar{x}_1 - \bar{x}_2$ is statistically significant when population SDs are known.

What is null hypothesis ($H_0$) in 2-sample Z-test?

$H_0: \mu_1 - \mu_2 = 0$ (no difference between population means).

When should I use 2-sample Z-test instead of 2-sample t-test?

Use a Z-test when population standard deviations $\sigma_1, \sigma_2$ are known or when both sample sizes are large ($n_1, n_2 \ge 30$).

How do I calculate a 2-sample Z-test in Excel?

Use formula =(xBar1 - xBar2) / SQRT((sigma1^2/n1) + (sigma2^2/n2)).

What is standard error of difference?

$\text{SE}_{\text{diff}} = \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}$.

Can sample sizes $n_1$ and $n_2$ be different?

Yes — Two-Sample Z-tests handle unequal sample sizes ($n_1 \neq n_2$) seamlessly.

What is critical Z-value for 95% confidence?

Two-tailed critical $Z = \pm 1.96$.

What is 95% confidence interval formula for mean difference?

$(\bar{x}_1 - \bar{x}_2) \pm 1.96 \cdot \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}$.

What non-parametric test replaces 2-sample Z-test?

The Mann-Whitney U test (Wilcoxon rank-sum test).

What is Cohen's d for two independent samples?

$\text{Cohen's d} = \frac{\bar{x}_1 - \bar{x}_2}{\sigma_{\text{pooled}}}$.