Theorem 1: Let x̄ and ȳ be the means of two samples of size nx and ny respectively. If x and y are normal or nx and ny are sufficiently large for the Central Limit Theorem to hold, then x̄ – ȳ has normal distribution with mean μx – μy and standard deviation
Proof: Since the samples are random, x̄ and ȳ are normally and independently distributed. By the Central Limit Theorem and Property 1 and 2 of Basic Characteristics of the Normal Distribution, we know that x̄ – ȳ is normally distributed with mean
and standard deviation
Hypothesis Testing: When the population is normal or the sample sizes are sufficiently large, we can use the above theorem to compare two population means. The theorem requires that the population standard deviations be known, which is usually not the case. Often, especially with large samples, the standard deviation of the samples can be used as an approximation for the population standard deviations. We can also employ the t-test (see Two Sample t-Test with Equal Variances and Two Sample t-Test with Unequal Variances) which doesn’t require that the variances be known, and is especially useful when the sample sizes are small.
Excel Tools: Excel provides a data analysis tool called z-Test: Two Sample for Means to automate the hypothesis testing process (as shown in Example 1).
Example 1: The average height of 5 year old boys in a certain country is known to be normally distributed with mean 95 cm and standard deviation 16 cm. A firm is selling a nutrient which it claims will significantly increase the height of children. In order to demonstrate its claim it selects a random sample of 60 four year old boys, half of whom are given the nutrient for one year and half of whom are not. Given that the heights of the boys at 5 years of age are as in the Figure 1, determine whether the nutrient is effective in increasing height.
Figure 1 – Two sample test using z-scores
In addition to the raw data, Figure 1 shows how to calculate the z-score for the difference between the sample means based on a normal population with a known standard deviation of 16 (i.e. a known variance of 162 = 256). Here the null hypothesis H0 is
This is a two-tail test, which is why the p-value (in cell I12) is doubled. Since p-value = .008 < .05 = α, we reject the null hypothesis, and conclude there is a significant difference between the boys that take the nutrients and those that don’t.
We can also use Excel’s data analysis tool to automatically calculate the z-score from the sample data (although we must first reorganize the data in the form of either a single row or single column). Figure 2 shows the output of the data analysis tool for Example 1.
Figure 2 – Output of z-Test: Two Sample for Means data analysis tool
Looking at the two-tail results, we see once again that .008 < .05 (or alternatively |z| = 2.65 > 1.96 = z-crit), and so we reject the null hypothesis.