Chapter 9: Hypothesis Testing with Two Samples
9.1 Two Population Means with Unknown Standard Deviations
Learning Objectives
By the end of this section, the student should be able to:
- Conduct and interpret hypothesis tests for two population means, population standard deviations unknown.
Hypothesis Tests for Two Population Means, Population Standard Deviations Unknown
- The two independent samples are simple random samples from two distinct populations.
- 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)
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]{\overline{X}}_{1}[/latex] – [latex]{\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]{\overline{X}}_{1}[/latex] – [latex]{\overline{X}}_{2}[/latex].
The test statistic (t-score) is calculated as follows:
and
[latex]{\overline{x}}_{2}[/latex]
are the sample means. μ1 and μ2 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:
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.)
Exercises
Example
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 [link]. Each population has a normal distribution.
| Sample Size | Average Number of Hours Playing Sports Per Day | Sample Standard Deviation | |
|---|---|---|---|
| Girls | 9 | 2 | [latex]0.866[/latex] |
| 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.
Solution
The population standard deviations are not known. Let g be the subscript for girls and b be the subscript for boys. Then, μg is the population mean for girls and μb is the population mean for boys. This is a test of two independent groups, two population means.
Random variable:
[latex]{\overline{X}}_{g}-{\overline{X}}_{b}[/latex]
= difference in the sample mean amount of time girls and boys play sports each day.
H0: μg = μb H0: μg – μb = 0
Ha: μg ≠ μb Ha: μg – μb ≠ 0
The words “the same” tell you H0 has an “=”. Since there are no other words to indicate Ha, assume it says “is different.”
This is a two-tailed test.
Distribution for the test:
Use tdf where df is calculated using the df formula for independent groups, two population means. Using a calculator, df is approximately 18.8462. Do not pool the variances.
Calculate the p-value using a Student’s t-distribution: p-value = 0.0054
Graph:
[latex]{s}_{g}=0.866[/latex]
[latex]{s}_{b}=1[/latex]
So, [latex]{\overline{x}}_{g}–{\overline{x}}_{b}[/latex] = 2 – 3.2 = –1.2
Half the p-value is below –1.2 and half is above 1.2.
Make a decision: Since α > p-value, reject H0. This means you reject μg = μb. The means are different.
Press STAT
. Arrow over to TESTS
and press 4:2-SampTTest
. Arrow over to Stats and press ENTER
. Arrow down and enter 2
for the first sample mean, [latex]\sqrt{0.866}[/latex]
for Sx1, 9
for n1, 3.2
for the second sample mean, 1
for Sx2, and 16
for n2. Arrow down to μ1: and arrow to does not equal
μ2. Press ENTER
. Arrow down to Pooled: and No
. Press ENTER
. Arrow down to Calculate
and press ENTER
. The p-value is p = 0.0054, the dfs are approximately 18.8462, and the test statistic is -3.14. Do the procedure again but instead of Calculate do Draw.
Conclusion: At the 5% level of significance, the sample data show there is sufficient evidence to conclude that the mean number of hours that girls and boys aged seven to 11 play sports per day is different (mean number of hours boys aged seven to 11 play sports per day is greater than the mean number of hours played by girls OR the mean number of hours girls aged seven to 11 play sports per day is greater than the mean number of hours played by boys).
Your Turn!
Two samples are shown in [link]. 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 |
Solution
The p-value is 0.4125, which is much higher than 0.05, so we decline to reject the null hypothesis. There is not sufficient evidence to conclude that the means of the two populations are not the same.
Note
Example
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.
a. Is this a test of two means or two proportions?
Solution
a. two means
b. Are the populations standard deviations known or unknown?
Solution
b. unknown
c. Which distribution do you use to perform the test?
Solution
c. Student’s t
d. What is the random variable?
Solution
d. [latex]{\overline{X}}_{A}-{\overline{X}}_{B}[/latex]
e. What are the null and alternate hypotheses? Write the null and alternate hypotheses in words and in symbols.
Solution
e.
f. Is this test right-, left-, or two-tailed?
Solution
f.
right
g. What is the p-value?
Solution
g. 0.1928
h. Do you reject or not reject the null hypothesis?
Solution
h. Do not reject.
i. Conclusion:
Solution
i. At the 1% level of significance, from the sample data, there is not sufficient evidence to conclude that a student who graduates from college A has taken more math classes, on the average, than a student who graduates from college B.
Your Turn!
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.
- Are the population standard deviations known?
- Conduct an appropriate hypothesis test. At the 5% significance level, what is your conclusion?
Solution
- They are unknown.
- The p-value = 0.0878. At the 5% level of significance, there is insufficient evidence to conclude that the workers of Company A stay longer with the company.
Example
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 [link] and [link].
| 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 |
| 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:
- Is this a test of two means or two proportions?
- Are the population standard deviations known or unknown?
- Which distribution do you use to perform the test?
- What is the random variable?
- What are the null and alternative hypotheses? Write the null and alternative hypotheses in words and in symbols.
- Is this test right, left, or two tailed?
- What is the p-value?
- Do you reject or not reject the null hypothesis?
- At the ___ level of significance, from the sample data, there ______ (is/is not) sufficient evidence to conclude that ______.
(See the conclusion in [link], and write yours in a similar fashion.)
First put the data for each group into two lists (such as L1 and L2). Press STAT. Arrow over to TESTS and press 4:2SampTTest. Make sure Data is highlighted and press ENTER. Arrow down and enter L1 for the first list and L2 for the second list. Arrow down to μ1: and arrow to ≠ μ2 (does not equal). Press ENTER. Arrow down to Pooled: No. Press ENTER. Arrow down to Calculate and press ENTER.
Note
Be careful not to mix up the information for Group 1 and Group 2!
Solution
- two means
- unknown
- Student’s t
- [latex]{\overline{X}}_{1}–{\overline{X}}_{2}[/latex]
- H0: μ1 = μ2 Null hypothesis: the means of the final exam scores are equal for the online and face-to-face statistics classes.
- Ha: μ1 < μ2 Alternative hypothesis: the mean of the final exam scores of the online class is less than the mean of the final exam scores of the face-to-face class.
- left-tailed
- p-value = 0.0011
- Reject the null hypothesis
- The professor was correct. The evidence shows that the mean of the final exam scores for the online class is lower than that of the face-to-face class.
At the 5% level of significance, from the sample data, there is (is/is not) sufficient evidence to conclude that the mean of the final exam scores for the online class is less than the mean of final exam scores of the face-to-face class.
Cohen’s Standards for Small, Medium, and Large Effect SizesCohen’s d is a measure of effect size based on the differences between two means. Cohen’s d, named for United States statistician Jacob Cohen, measures the relative strength of the differences between the means of two populations based on sample data. The calculated value of effect size is then compared to Cohen’s standards of small, medium, and large effect sizes.
| Size of effect | d |
|---|---|
| Small | 0.2 |
| medium | 0.5 |
| Large | 0.8 |
Cohen’s d is the measure of the difference between two means divided by the pooled standard deviation: [latex]d=\frac{{\overline{x}}_{1}–{\overline{x}}_{2}}{{s}_{pooled}}[/latex] where [latex]{s}_{pooled}=\sqrt{\frac{\left({n}_{1}–1\right){s}_{1}^{2}+\left({n}_{2}–1\right){s}_{2}^{2}}{{n}_{1}+{n}_{2}–2}}[/latex]
Example
Calculate Cohen’s d for [link]. Is the size of the effect small, medium, or large? Explain what the size of the effect means for this problem.
Solution
μ1 = 4 s1 = 1.5 n1 = 11
μ2 = 3.5 s2 = 1 n2 = 9
d = 0.384
The effect is small because 0.384 is between Cohen’s value of 0.2 for small effect size and 0.5 for medium effect size. The size of the differences of the means for the two colleges is small indicating that there is not a significant difference between them.
Example
Calculate Cohen’s d for [link]. Is the size of the effect small, medium or large? Explain what the size of the effect means for this problem.
Solution
d = 0.834; Large, because 0.834 is greater than Cohen’s 0.8 for a large effect size. The size of the differences between the means of the Final Exam scores of online students and students in a face-to-face class is large indicating a significant difference.
Your Turn!
Weighted alpha is a measure of risk-adjusted performance of stocks over a period of a year. A high positive weighted alpha signifies a stock whose price has risen while a small positive weighted alpha indicates an unchanged stock price during the time period. Weighted alpha is used to identify companies with strong upward or downward trends. The weighted alpha for the top 30 stocks of banks in the northeast and in the west as identified by Nasdaq on May 24, 2013, are listed in [link] and [link], respectively.
| 94.2 | 75.2 | 69.6 | 52.0 | 48.0 | 41.9 | 36.4 | 33.4 | 31.5 | 27.6 |
| 77.3 | 71.9 | 67.5 | 50.6 | 46.2 | 38.4 | 35.2 | 33.0 | 28.7 | 26.5 |
| 76.3 | 71.7 | 56.3 | 48.7 | 43.2 | 37.6 | 33.7 | 31.8 | 28.5 | 26.0 |
| 126.0 | 70.6 | 65.2 | 51.4 | 45.5 | 37.0 | 33.0 | 29.6 | 23.7 | 22.6 |
| 116.1 | 70.6 | 58.2 | 51.2 | 43.2 | 36.0 | 31.4 | 28.7 | 23.5 | 21.6 |
| 78.2 | 68.2 | 55.6 | 50.3 | 39.0 | 34.1 | 31.0 | 25.3 | 23.4 | 21.5 |
Is there a difference in the weighted alpha of the top 30 stocks of banks in the northeast and in the west? Test at a 5% significance level. Answer the following questions:
- Is this a test of two means or two proportions?
- Are the population standard deviations known or unknown?
- Which distribution do you use to perform the test?
- What is the random variable?
- What are the null and alternative hypotheses? Write the null and alternative hypotheses in words and in symbols.
- Is this test right, left, or two tailed?
- What is the p-value?
- Do you reject or not reject the null hypothesis?
- At the ___ level of significance, from the sample data, there ______ (is/is not) sufficient evidence to conclude that ______.
- Calculate Cohen’s d and interpret it.
Solution
- two means
- unknown
- Student’s-t
- [latex]{\overline{X}}_{1}\text{ - }{\overline{X}}_{2}[/latex]
- H0 : μ1 = μ2 Null hypothesis: the means of the weighted alphas are equal.
- Ha : μ1 ≠ μ2 Alternative hypothesis : the means of the weighted alphas are not equal.
- two-tailed
- p-value = 0.8787
- Do not reject the null hypothesis
- This indicates that the trends in stocks are about the same in the top 30 banks in each region.
5% level of significance, from the sample data, there is not sufficient evidence to conclude that the mean weighted alphas for the banks in the northeast and the west are different
- d = 0.040, Very small, because 0.040 is less than Cohen’s value of 0.2 for small effect size. The size of the difference of the means of the weighted alphas for the two regions of banks is small indicating that there is not a significant difference between their trends in stocks.
References
Data from Graduating Engineer + Computer Careers. Available online at http://www.graduatingengineer.com
Data from Microsoft Bookshelf.
Data from the United States Senate website, available online at www.Senate.gov (accessed June 17, 2013).
“List of current United States Senators by Age.” Wikipedia. Available online at http://en.wikipedia.org/wiki/List_of_current_United_States_Senators_by_age (accessed June 17, 2013).
“Sectoring by Industry Groups.” Nasdaq. Available online at http://www.nasdaq.com/markets/barchart-sectors.aspx?page=sectors&base=industry (accessed June 17, 2013).
“Strip Clubs: Where Prostitution and Trafficking Happen.” Prostitution Research and Education, 2013. Available online at www.prostitutionresearch.com/ProsViolPosttrauStress.html (accessed June 17, 2013).
“World Series History.” Baseball-Almanac, 2013. Available online at http://www.baseball-almanac.com/ws/wsmenu.shtml (accessed June 17, 2013).
The number of objects in a sample that are free to vary
A number that is equal to the square root of the variance and measures how far data values are from their mean; notation: s for sample standard deviation and σ for population standard deviation.
The average distance (deviation) of each observation from the mean
A probability model quantifying a situation; can equal the values of the possible outcomes. Represented using a capital letter.