Two-Sample Z-Test Statistic
Worked example: means 82 vs 76, sigma 10 each, n 25 and 20 → z = 2 — press Try an example to run it live, then adjust anything.
Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value. Try different units for next level excitement!
Two-Sample Z-Test Statistic explained
To compare two independent groups you need the standard error of the difference, and variances of independent quantities add: σ₁²/n₁ + σ₂²/n₂. Take the square root, divide the gap between the means by it, and you have a z that is read against the normal table exactly like a one-sample test. Two production lines averaging 82 and 76 with σ = 10 each and samples of 25 and 20 give a standard error of √(4 + 5) = 3, so z = 6/3 = 2.0 — just past the two-sided 5% cutoff.
The mistake to avoid is averaging the two standard errors, or worse, comparing each group's confidence interval and concluding "they overlap, so no difference". Overlapping intervals frequently hide a significant difference, because the error on the gap is smaller than the sum of the individual errors. Note also that the smaller group dominates the denominator: with n₁ = 25 and n₂ = 20 above, shrinking group 2 to 5 observations would push the standard error from 3 to 4.9 and kill the result outright, no matter how large group 1 grew. Balance your groups when you can.
Two-Sample Z-Test Statistic formula
- = Test statistic
- = Mean of sample 1
- = Mean of sample 2
- = Standard deviation 1
- = Size of sample 1
- = Standard deviation 2
- = Size of sample 2
Missing one of these? Work it out first, then come back
- Test statistic — One-Sample Z-Test Statistic, One-Sample T-Test Statistic
- Mean of sample 1 — Confidence Interval Lower Limit, Confidence Interval Upper Limit
- Mean of sample 2 — Confidence Interval Lower Limit, Confidence Interval Upper Limit
- Standard deviation 1 — Z-Score (Standard Score), Variance and Standard Deviation
- Size of sample 1 — Standard Error of the Mean, Margin of Error for a Mean
- Standard deviation 2 — Z-Score (Standard Score), Variance and Standard Deviation
- Size of sample 2 — Standard Error of the Mean, Margin of Error for a Mean