Testing for Two Population Means

Learning Outcomes

  • Conduct a hypothesis test for a difference in two population means with unknown standard deviations and interpret the conclusion in context
  1. The two independent samples are simple random samples from two distinct populations.
  2. For the two distinct populations:
    • if the sample sizes are small, the distributions are important (should be normal)
    • if the sample sizes are large, the distributions are not important (need not be normal)

Note: The test comparing two independent population means with unknown and possibly unequal population standard deviations is called the Aspin-Welch t-test. The degrees of freedom formula was developed by Aspin-Welch.

The comparison of two population means is very common. A difference between the two samples depends on both the means and the standard deviations. Very different means can occur by chance if there is great variation among the individual samples. In order to account for the variation, we take the difference of the sample means, [latex]\displaystyle\overline{{X}}_{{1}}-\overline{{X}}_{{2}} [/latex], and divide by the standard error in order to standardize the difference. The result is a t-score test statistic.

Because we do not know the population standard deviations, we estimate them using the two-sample standard deviations from our independent samples. For the hypothesis test, we calculate the estimated standard deviation, or standard error, of the difference in sample means, [latex]\displaystyle\overline{{X}}_{{1}}-\overline{{X}}_{{2}} [/latex].

The standard error is: [latex]\displaystyle\sqrt{\frac{(s_1)^2}{n_1}+\frac{(s_2)^2}{n_2}} [/latex]

Recall: Order of Operations

When simplifying mathematical expressions perform the operations in the following order:
1. Parentheses and other Grouping Symbols

  • Simplify all expressions inside the parentheses or other grouping symbols, working on the innermost parentheses first.

2. Exponents

  • Simplify all expressions with exponents.

3. Multiplication and Division

  • Perform all multiplication and division in order from left to right. These operations have equal priority.

4. Addition and Subtraction

  • Perform all addition and subtraction in order from left to right. These operations have equal priority.

For the standard error formula, you would follow the following steps:

First, calculate [latex]\frac{(s_1)^2}{n_1}[/latex] by removing the parentheses by squaring the standard deviation of the first data set and then divide by n of the first data set.

Second, calculate [latex]\frac{(s_2)^2}{n_2}[/latex] by removing the parentheses by squaring the standard deviation of the second data set and then divide by n of the second data set.

Third, add what you got in both previous steps and then take the square root of the sum.

The test statistic (t-score) is calculated as follows: [latex]t= \dfrac{(\overline{x}_1-\overline{x}_2)-(\mu_1-\mu_2)}{\displaystyle\sqrt{\frac{(s_1)^2}{n_1}+\frac{(s_2)^2}{n_2}}} [/latex]

Where:

  • s1 and s2, the sample standard deviations, are estimates of σ1 and σ2, respectively.
  • σ1 and σ1 are the unknown population standard deviations.
  • [latex]\displaystyle\overline{{x}}_{{1}} [/latex] and [latex]\overline{{x}}_{{2}} [/latex] are the sample means.
  • [latex]\mu_1 [/latex] and [latex]\mu_2[/latex] are the population means.

The number of degrees of freedom (df) requires a somewhat complicated calculation. However, a computer or calculator calculates it easily. The df are not always a whole number. The test statistic calculated previously is approximated by the Student’s t-distribution with df as follows:

[latex]\displaystyle{df}=\dfrac{((\dfrac{(s_1)^2}{n_1})+(\dfrac{(s_2)^2}{n_2}))^2}{(\dfrac{1}{n_1-1})(\dfrac{(s_1)^2}{n_1})^2+(\dfrac{1}{n_2-1})(\dfrac{(s_2)^2}{n_2})^2} [/latex]

When both sample sizes n1 and n2 are five or larger, the Student’s t approximation is very good. Notice that the sample variances (s1)2 and (s2)2 are not pooled. (If the question comes up, do not pool the variances.)

Note: It is not necessary to compute this by hand. A calculator or computer easily computes it.

Example 1

Independent groups

The average amount of time boys and girls aged seven to 11 spend playing sports each day is believed to be the same. A study is done and data are collected, resulting in the data in the table below. Each populations has a normal distribution.

Sample Size Average Number of Hours Playing Sports Per Day Sample Standard Deviation
Girls 9 2 0.866
Boys 16 3.2 1.00

Is there a difference in the mean amount of time boys and girls aged seven to 11 play sports each day? Test at the 5% level of significance.

try it 1

Two samples are shown in the table. Both have normal distributions. The means for the two populations are thought to be the same. Is there a difference in the means? Test at the 5% level of significance.

Sample Size Sample Mean Sample Standard Deviation
Population A 25 5 1
Population B 16 4.7 1.2

Note: When the sum of the sample sizes is larger than 30 (n1 + n2 > 30) you can use the normal distribution to approximate the Student’s t.

Example 2

A study is done by a community group in two neighboring colleges to determine which one graduates students with more math classes. College A samples 11 graduates. Their average is four math classes with a standard deviation of 1.5 math classes. College B samples nine graduates. Their average is 3.5 math classes with a standard deviation of one math class. The community group believes that a student who graduates from College A has taken more math classes, on the average. Both populations have a normal distribution. Test at a 1% significance level. Answer the following questions.

  1. Is this a test of two means or two proportions?
  2. Are the populations standard deviations known or unknown?
  3. Which distribution do you use to perform the test?
  4. What is the random variable?
  5. What are the null and alternate hypotheses?
  6. Is this test right-, left-, or two-tailed?
  7. What is the p-value?
  8. Do you reject or not reject the null hypothesis?

try it 2

A study is done to determine if Company A retains its workers longer than Company B. Company A samples 15 workers, and their average time with the company is five years with a standard deviation of 1.2. Company B samples 20 workers, and their average time with the company is 4.5 years with a standard deviation of 0.8. The populations are normally distributed.

  1. Are the population standard deviations known?
  2. Conduct an appropriate hypothesis test. At the 5% significance level, what is your conclusion?

Example 3

A professor at a large community college wanted to determine whether there is a difference in the means of final exam scores between students who took his statistics course online and the students who took his face-to-face statistics class. He believed that the mean of the final exam scores for the online class would be lower than that of the face-to-face class. Was the professor correct? The randomly selected 30 final exam scores from each group are listed in the two tables below:

Online Class:

67.6 41.2 85.3 55.9 82.4 91.2 73.5 94.1 64.7 64.7
70.6 38.2 61.8 88.2 70.6 58.8 91.2 73.5 82.4 35.5
94.1 88.2 64.7 55.9 88.2 97.1 85.3 61.8 79.4 79.4

Face-to-face Class:

77.9 95.3 81.2 74.1 98.8 88.2 85.9 92.9 87.1 88.2
69.4 57.6 69.4 67.1 97.6 85.9 88.2 91.8 78.8 71.8
98.8 61.2 92.9 90.6 97.6 100 95.3 83.5 92.9 89.4

Is the mean of the Final Exam scores of the online class lower than the mean of the Final Exam scores of the face-to-face class? Test at a 5% significance level. Answer the following questions:

  1. Is this a test of two means or two proportions?
  2. Are the population standard deviations known or unknown?
  3. Which distribution do you use to perform the test?
  4. What is the random variable?
  5. What are the null and alternative hypotheses? Write the null and alternative hypotheses in words and in symbols.
  6. Is this test right, left, or two tailed?
  7. What is the p-value?
  8. Do you reject or not reject the null hypothesis?
  9. At the ___ level of significance, from the sample data, there ______ (is/is not) sufficient evidence to conclude that ______.

(Review the conclusion in Example 2, and write yours in a similar fashion)

Be careful not to mix up the information for Group 1 and Group 2!