z test two sample for means in Excel using the QI Macros
When to use the z test two sample for means
Use the z test two-sample for means:
- to compare population and sample means to determine if there is a significant difference
- to compare means between two samples,
- to compare the mean of one sample to a given constant.
The Z-test is typically used in evaluating the results of standardized tests. Are the results from a sample of students outside of or within the standard test performance?
Consider the following example taken from Statistical Analysis in Excel for Dummies by Joseph Schmuller.
New Training Technique Designed to Increase IQ
Imagine a new training technique designed to increase IQ. Take a sample of 25 people and train them using the new technique. Take another sample of 25 people and give them no special training.
- The null hypothesis H0 is that the mean difference = 0
or in other words the means are the same
- The alternative hypothesis Ha is that the mean difference is > 0
or in other words that the mean of the trained population is larger
Now, conduct a test with the two samples and input their scores into Excel:
Then, select the data with the mouse and click on the QI Macros Menu to select the z test two sample for means test:
The QI Macros will prompt for a significance level (default = 0.05):
a hypothesized mean difference (in this case 0 ):
and variances for variables 1 and 2
The QI Macros z test will perform the calculations and interpret the results for you:
Interpreting the z test results
|test statistic > critical value
(i.e. z> zcrit)
|Reject the null hypothesis|
|test statistic < critical value
(i.e. z< zcrit)
|Cannot Reject the null hypothesis|
|p value < a||Reject the null hypothesis|
|p value > a||Cannot Reject the null hypothesis|
Since the null hypothesis is that the means are the same this is a two-sided test. Therefore, use the two-tail values for your analysis.
Since the z statistic < zcritical (1.305 < 1.960) and p value > a ( 0.192> 0.05) , we cannot reject the null hypothesis that the means are the same.