Statistics
Textbooks
Boundless Statistics
Estimation and Hypothesis Testing
Hypothesis Testing: Two Samples
Statistics Textbooks Boundless Statistics Estimation and Hypothesis Testing Hypothesis Testing: Two Samples
Statistics Textbooks Boundless Statistics Estimation and Hypothesis Testing
Statistics Textbooks Boundless Statistics
Statistics Textbooks
Statistics
Concept Version 7
Created by Boundless

Comparing Two Independent Population Means

To compare independent samples, both populations are normally distributed with the population means and standard deviations unknown.

Learning Objective

  • Outline the mechanics of a hypothesis test comparing two independent population means.


Key Points

    • 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 and divide by the standard error in order to standardize the difference.
    • Because we do not know the population standard deviations, we estimate them using the two sample standard deviations from our independent samples.

Terms

  • degrees of freedom (df)

    The number of objects in a sample that are free to vary.

  • t-score

    A score utilized in setting up norms for standardized tests; obtained by linearly transforming normalized standard scores.


Full Text

Independent samples are simple random samples from two distinct populations. To compare these random samples, both populations are normally distributed with the population means and standard deviations unknown unless the sample sizes are greater than 30. In that case, the populations need not be normally distributed.

The comparison of two population means is very common. The 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,

X1¯−X2¯\bar { { X }_{ 1 } } -\bar { { X }_{ 2 } }​X​1​​​¯​​−​X​2​​​¯​​

and divide by the standard error (shown below) in order to standardize the difference. The result is a ttt-score test statistic (also shown below).

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,

X1¯−X2¯\bar { { X }_{ 1 } } -\bar { { X }_{ 2 } }​X​1​​​¯​​−​X​2​​​¯​​.

The standard error is:

S12n1+S22n2\displaystyle \sqrt { \frac { { S }_{ 1 }^{ 2 } }{ { n }_{ 1 } } +\frac { { S }_{ 2 }^{ 2 } }{ { n }_{ 2 } } }√​​n​1​​​​S​1​2​​​​+​n​2​​​​S​2​2​​​​​​​.

The test statistic (ttt-score) is calculated as follows:

(X1¯−X2¯)−(μ1−μ2)S12n1+S22n2\dfrac { (\bar { { X }_{ 1 } } -\bar { { X }_{ 2 } } )-({ \mu }_{ 1 }-{ \mu }_{ 2 }) }{ \sqrt { \dfrac { { S }_{ 1 }^{ 2 } }{ { n }_{ 1 } } +\dfrac { { S }_{ 2 }^{ 2 } }{ { n }_{ 2 } } } }​√​​n​1​​​​S​1​2​​​​+​n​2​​​​S​2​2​​​​​​​​​(​X​1​​​¯​​−​X​2​​​¯​​)−(μ​1​​−μ​2​​)​​.

The degrees of freedom (dfdfdf) is a somewhat complicated calculation. The dfdfdfs are not always a whole number. The test statistic calculated above is approximated by the student's-ttt distribution with dfdfdfs as follows:

df=(S12n1+S22n2)2[(1n1−1)⋅(S12n1)2+(1n2−1)⋅(S22n2)2]\displaystyle df=\frac { { \left( \frac { { S }_{ 1 }^{ 2 } }{ { n }_{ 1 } } +\frac { { S }_{ 2 }^{ 2 } }{ { n }_{ 2 } } \right) }^{ 2 } }{ \left[ \left( \frac { 1 }{ { n }_{ 1 } } -1 \right) \cdot { \left( \frac { { S }_{ 1 }^{ 2 } }{ { n }_{ 1 } } \right) }^{ 2 }+\left( \frac { 1 }{ { n }_{ 2 } } -1 \right) \cdot { \left( \frac { { S }_{ 2 }^{ 2 } }{ { n }_{ 2 } } \right) }^{ 2 } \right] }df=​[(​n​1​​​​1​​−1)⋅(​n​1​​​​S​1​2​​​​)​2​​+(​n​2​​​​1​​−1)⋅(​n​2​​​​S​2​2​​​​)​2​​]​​(​n​1​​​​S​1​2​​​​+​n​2​​​​S​2​2​​​​)​2​​​​

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

Example

The average amount of time boys and girls ages 7 through 11 spend playing sports each day is believed to be the same. An experiment is done, data is collected, resulting in the table below. Both populations have a normal distribution. 

Independent Sample Table 1

This table lays out the parameters for our example.

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

Solution

The population standard deviations are not known. Let ggg be the subscript for girls and bbb be the subscript for boys. Then, μg\mu_gμ​g​​ is the population mean for girls and μb\mu_bμ​b​​ is the population mean for boys. This is a test of two independent groups, two population means.

The random variable: Xg¯−Xb¯\bar { { X }_{ g } } -\bar { { X }_{ b } }​X​g​​​¯​​−​X​b​​​¯​​ is the difference in the sample mean amount of time girls and boys play sports each day.

H0:μg=μbg−b=0H_0: \mu_g = \mu_{bg-b} = 0H​0​​:μ​g​​=μ​bg−b​​=0

Ha:μg≠μbg−b≠0H_a: \mu_g \neq \mu_{bg-b} \neq 0H​a​​:μ​g​​≠μ​bg−b​​≠0

The words "the same" tell you H0H_0H​0​​ has an "=". Since there are no other words to indicate HaH_aH​a​​, then assume "is different." This is a two-tailed test.

Distribution for the test: Use tdft_{df}t​df​​ where dfdfdf is calculated using the dfdfdf formula for independent groups, two population means. Using a calculator, dfdfdf is approximately 18.8462.

Calculate the ppp-value using a student's-ttt distribution: p-value=0.0054p\text{-value} = 0.0054p-value=0.0054

Graph:

Graph for Example

This image shows the graph for the ppp-values in our example.

sg=0.75{ s }_{ g }=\sqrt { 0.75 }s​g​​=√​0.75​​​

sb=1{ s }_{ b }=1s​b​​=1

so, Xg¯−Xb¯=2−3.1=−1.2\bar { { X }_{ g } } -\bar { { X }_{ b } }=2-3.1=-1.2​X​g​​​¯​​−​X​b​​​¯​​=2−3.1=−1.2

Half the ppp-value is below −1.2-1.2−1.2 and half is above 1.2.

Make a decision: Since α>p-value\alpha > p\text{-value}α>p-value, reject H0H_0H​0​​. This means you reject μg=μb\mu_g = \mu_bμ​g​​=μ​b​​. The means are different.

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 7 through 11 play sports per day is different (the mean number of hours boys aged 7 through 11 play sports per day is greater than the mean number of hours played by girls OR the mean number of hours girls aged 7 through 11 play sports per day is greater than the mean number of hours played by boys).

[ edit ]
Edit this content
Prev Concept
Using Two Samples
Comparing Two Independent Population Proportions
Next Concept
Subjects
  • Accounting
  • Algebra
  • Art History
  • Biology
  • Business
  • Calculus
  • Chemistry
  • Communications
  • Economics
  • Finance
  • Management
  • Marketing
  • Microbiology
  • Physics
  • Physiology
  • Political Science
  • Psychology
  • Sociology
  • Statistics
  • U.S. History
  • World History
  • Writing

Except where noted, content and user contributions on this site are licensed under CC BY-SA 4.0 with attribution required.