9.2 - Two Independent Means

9.2 - Two Independent Means

Let's explore how we can compare the means of two independent groups. If the populations are known to be approximately normally distributed, or if both sample sizes are at least 30, then the sampling distribution can be estimated using the \(t\) distribution. If this assumption is not met then simulation methods (i.e., bootstrapping or randomization) may be used.


9.2.1 - Confidence Intervals

9.2.1 - Confidence Intervals

Given that the populations are known to be normally distributed, or if both sample sizes are at least 30, then the sampling distribution can be approximated using the \(t\) distribution, and the formulas below may be used. Here you will be introduced to the formulas to construct a confidence interval using the \(t\) distribution. Minitab Express will do all of these calculations for you, however, it uses a more sophisticated method to compute the degrees of freedom so answers may vary slightly, particularly with smaller sample sizes. 

General Form of a Confidence Interval
\(point \;estimate \pm (multiplier) (standard \;error)\)

Here, the point estimate is the difference between the two mean, \(\overline X _1 - \overline X_2\).

Standard Error
\(\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}\)
Confidence Interval for Two Independent Means
\((\bar{x}_1-\bar{x}_2) \pm t^\ast{ \sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}\)

The degrees of freedom can be approximated as the smallest sample size minus one.

Estimated Degrees of Freedom

\(df=smallest\;n-1\)

Example: Exam Scores by Learner Type

A STAT 200 instructor wants to know how traditional students and adult learners differ in terms of their final exam scores. She collected the following data from a sample of students:

Descriptive Statistics
  Traditional Students Adult Learners

\(\overline x\)

41.48 40.79
\(s\) 6.03 6.79
\(n\) 239 138

She wants to construct a 95% confidence interval to estimate the mean difference. 

 

The point estimate, or "best estimate," is the difference in sample means: \(\overline x _1 - \overline x_2 = 41.48-40.79=0.69\)

The standard error can be computed next: \(\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}=\sqrt{\frac{6.03^2}{239}+\frac{6.79^2}{138}}=0.697\)

To find the multiplier, we need to construct a t distribution with \(df=smaller\;n-1=138-1=137\) to find the t scores that separate the middle 95% of the distribution from the outer 5% of the distribution:

Minitab Express was used to construct a t distribution with 137 degrees of freedom to find the t scores that separate the middle 95% from the outer 5%. Those t scores are plus and minus 1.97743

\(t^*=1.97743\)

Now, we can combine all of these values to construct our confidence interval: 

\(point \;estimate \pm (multiplier) (standard \;error)\)

\(0.69 \pm 1.97743 (0.697)\)

\(0.69 \pm 1.379\) The margin of error is 1.379

\([-0.689, 2.069]\) 

We are 95% confident that the mean difference in traditional students' and adult learners' final exam scores is between -0.689 points and +2.069 points. 


9.2.1.1 - Minitab Express: Confidence Interval Between 2 Independent Means

9.2.1.1 - Minitab Express: Confidence Interval Between 2 Independent Means

Minitab Express can be used to construct a confidence interval for the difference between two independent means. Note that the confidence intervals given in the Minitab Express output assume that either the populations are normally distributed or that both sample sizes are at least 30.

MinitabExpress  – Confidence Interval Between 2 Independent Means

Let's estimate the difference between the mean weight (in pounds) of females and the mean weight of males. Both sample sizes are at least 30 so the sampling distribution can be approximated using the t distribution. Above, we found that the sample standard deviations are similar, so we will assume equal variances. 

  1. Open the Minitab Express file:
  2. On a PC: In the menu bar select STATISTICS > Two Samples > t
  3. On a Mac: In the menu bar select Statistics > 2-Sample Inference > t
  4. Double click the variable Weight in the box on the left to insert the variable into the Samples box
  5. Double click the variable Gender in the box on the left to insert the variable into the Sample IDs box
  6. Click OK

This should result in the following output:

2-Sample t: Weight by Gender
Method
\(\mu_1\): mean of Weight when Gender = Female
\(\mu_2\): mean of Weight when Gender = Male
Difference: \(\mu_1-\mu_2\)

Equal variances are not assumed for this analysis.

Descriptive Statistics: Weight
Gender N Mean StDev SE Mean
Female 126 136.722 23.362 2.081
Male 99 172.717 27.301 2.744
Estimation for Difference
Difference 95% CI for Difference
-35.995 (-42.787, -29.202)
Video Walkthrough

Select your operating system below to see a step-by-step guide for this example.

I am 95% confident that in the population the mean weight of females is between 29.202 pounds and 42.787 pounds less than the mean weight of males.


9.2.2 - Hypothesis Testing

9.2.2 - Hypothesis Testing

The formula for the test statistic follows the same general format as the others that we have seen this week:

Test Statistic
\(test\; statistic = \dfrac{sample \; statistic - null\;parameter}{standard \;error}\)

Minitab Express will compute the test statistic for you! You will just need to determine if equal variances should be assumed or not. There is one example below walking through these procedures by hand, but you are strongly encouraged to use Minitab Express whenever possible.

1. Check any necessary assumptions and write null and alternative hypotheses.

There are two assumptions: (1) the two samples are independent and (2) both populations are normally distributed or \(n_1 \geq 30\) and \(n_2 \geq 30\). If the second assumption is not met then you can conduct a randomization test.

Below are the possible null and alternative hypothesis pairs:

Research Question Are the means of group 1 and group 2 different? Is the mean of group 1 greater than the mean of group 2? Is the mean of group 1 less than the mean of group 2?
Null Hypothesis, \(H_{0}\) \(\mu_1 = \mu_2\) \(\mu_1 = \mu_2\) \(\mu_1 = \mu_2\)
Alternative Hypothesis, \(H_{a}\) \(\mu_1 \neq \mu_2\) \(\mu_1 > \mu_2\) \(\mu_1 < \mu_2\)
Type of Hypothesis Test Two-tailed, non-directional Right-tailed, directional Left-tailed, directional
2. Calculate an appropriate test statistic.

Standard Error

\(\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\)

Test Statistic for Independent Means

\(t=\dfrac{\bar{x}_1-\bar{x}_2}{ \sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}\)

Estimated Degrees of Freedom

\(df=smallest\;n - 1\)

3. Determine the p-value associated with the test statistic.

The \(t\) test statistic found in Step 2 is used to determine the p-value. 

4. Decide between the null and alternative hypotheses.

If \(p \leq \alpha\) reject the null hypothesis. If \(p>\alpha\) fail to reject the null hypothesis.

5. State a "real world" conclusion.

Based on your decision in Step 4, write a conclusion in terms of the original research question.


9.2.2.1 - Minitab Express: Independent Means t Test

9.2.2.1 - Minitab Express: Independent Means t Test

Here we will use Minitab Express to conduct an independent means t test. Note that Minitab Express uses a more complicated formula for computing the degrees of freedom for this test. To read more about the formulas that Minitab Express uses, see Minitab Express Support.

Within Minitab Express, the procedure for obtaining the test statistic and confidence interval for independent means is identical.

MinitabExpress  – Conducting an Independent Means t Test

Let's compare the mean SAT-Math scores of students who have and have not ever cheated. Both sample sizes are at least 30 so the sampling distribution can be approximated using the \(t\) distribution. Above, we found that the sample standard deviations are similar, so we will assume equal variances. 

  1. Open the Minitab Express file:
  2. On a PC: In the menu bar select STATISTICS > Two Samples > t
  3. On a Mac: In the menu bar select Statistics > 2-Sample Inference > t
  4. Double click the variable SATM in the box on the left to insert the variable into the Samples box
  5. Double click the variable Ever Cheat in the box on the left to insert the variable into the Sample IDs box
  6. Click OK

This should result in the following output:

2-Sample t: SATM by Ever Cheat
Method
\(\mu_1\): mean of SATM when Ever Cheat = No
\(\mu_2\): mean of SATM when Ever Cheat = Yes
Difference: \(\mu_1-\mu_2\)

Equal variances are not assumed for this analysis.

Descriptive Statistics: SATM
Ever Cheat N Mean StDev SE Mean
No 163 603.988 86.893 6.806
Yes 53 583.68 79.18 10.88
Estimation for Difference
Difference 95% CI for Difference
20.31 (-5.16, 45.78)
Test
Null hypothesis \(H_0\): \(\mu_1-\mu_2=0\)
Alternative hypothesis \(H_1\): \(\mu_1-\mu_2\neq0\)
T-Value DF P-Value
1.58 95 0.1168
Video Walkthrough

Select your operating system below to see a step-by-step guide for this example.

The result of our two independent means t test is \(t(95) = 1.58, p = 0.1168\). Our p-value is greater than the standard alpha level of 0.05 so we fail to reject the null hypothesis. There is not evidence to state that the mean SAT-Math scores of students who have and have not ever cheated are different. 

Note that we could also interpret the confidence interval in this output. We are 95% confident that the mean difference in the population is between -5.16 and 45.78.

The example above uses a dataset. The following examples show how you can conduct this type of test using summarized data.


9.2.2.1.1 - Video Example: SAT-Verbal Scores

9.2.2.1.1 - Video Example: SAT-Verbal Scores

Research question: Do students who complete test prep program A have higher SAT-Verbal scores than students who complete test prep program B?

The following data were collected from representative samples of students who were randomly assigned to complete either program A or program B.

  Program A Program B
\(\overline X\) 530 510
\(s\) 90 80
\(n\) 35 30

The sampling distribution may be approximated using the t distribution because \(n_A \ge 30\) and \(n_B \ge 30\). 

Let's take a look at how we can go about solving this research question using Minitab Express.


9.2.2.1.2 - Video Example: Comparing Kids' Weight by Gender

9.2.2.1.2 - Video Example: Comparing Kids' Weight by Gender

A school nurse wants to know if the fifth grade boys at his school weigh more than the fifth grade girls on average. This is an example of a one-tailed (directional) test of two independent means using summarized data.


9.2.2.1.3 - Video Example: Hotel Ratings

9.2.2.1.3 - Video Example: Hotel Ratings

A group of hotel management students wants to compare guest satisfaction ratings from two hotels. A random sample guests from each hotel are asked to rate their level of satisfaction on a scale from 0 to 100. This is an example of a two-tailed (non-directional) test for two independent means using summarized data.


Legend
[1]Link
Has Tooltip/Popover
 Toggleable Visibility