# Confidence Intervals: Mean Difference from Two Independent Samples & Equal Variance

Instructor: Christopher Haines
In this lesson, we derive a formula for a confidence interval for the difference of two population means. The samples are assumed to be independent and taken from two normal distributions with possibly different means and equal standard deviations. In addition, the common standard deviation is assumed to be unknown.

## Confidence Interval for Difference in Means when Samples are Independent

### The Model

Suppose we have two normal distributions, and we take an independent sample from each distribution. Additionally, we assume the two population standard deviations are equal. More precisely, we let

and

The population means could possibly differ, and the common standard deviation is unknown.

### Derivation of Confidence Interval

We would like to find an interval which captures the difference in means with a prescribed level of certainty. That is,

To begin, we first derive the distribution for the following statistic.

In the formula of T, we have defined:

and

First note that since we have two independent samples from separate normal distributions,

and

Now with the help of the following theorem, we can establish that T is a t random variable with n + m - 2 degrees of freedom. For the sake of simplicity, we do not prove this theorem here.

#### Theorem: T Statistic Distribution

Suppose a random variable T has a t distribution with d degrees of freedom. Then,

As a consequence of (2), (1) has a t distribution with n + m - 2 degrees of freedom.

We can now use this result to derive a confidence interval. First observe that

is equivalent to

Therefore,

This means that the random interval

We now give two examples showing the computations needed to construct this particular confidence interval.

### Computational Examples

#### Example 1

The following data are individual batting averages for each player on teams A and B. It is believed that the batting average of a player follows a normal distribution. It is also believed that the standard deviation for team A is equal to the standard deviation for team B.

Team A Team B
0.264401556452649
0.286801353669725
0.285477015697106
0.263245548896302
0.249198170169402
0.268527147226923
0.267638531112898
0.290230447717040
0.263950507359841
0.282326574960753

Based on the table above, construct a 95% confidence interval for the difference in mean batting averages. (Team A minus Team B)

#### Solution

We are constructing a confidence interval for the parameter

We let Team A represent the X sample, and Team B represent the Y sample. From the data, we compute the following summary statistics:

Therefore the pooled sample variance is

The degrees of freedom for the T statistic is 5 + 5 - 2 = 8. Also,

So the margin of error is

The 95% confidence interval is then

#### Example 2

A store manager would like to investigate the possibility of a new cashier taking or withholding store revenue. He compares this employee's over/under chart performances to another more reliable employee. The amounts for over and under are given in the table shown below. Assume that both employees over/under amounts are normally distributed, and that the two distributions have equal standard deviations. Also assume that the current employee's over/under history is independent of the former employee's over/under history. (This would seem reasonable if these two subjects had no contact with one another, and their employment periods were several years apart.)

Current Employee Former Employee
0.77
0.04
1.18
1.96
1.90
2.30
-0.64
0.82
1.82
0.18
0.48
-0.27
-0.39
0.27
0.42
-0.59
0.57
0.70
1.10
0.73
0.32
-0.13
0.07
-0.07
-1.16
-0.51
0.84
0.16
0.63
-0.37
-0.95
1.19
0.36
-0.17
0.38
-1.15
1.09
-1.43
-0.32
2.57
1.02
-0.25
-1.27
-0.57
0.04

Let the current employee's data be the X sample and the former employee's data be the Y sample. Construct a 99% confidence interval for the difference in means. (Mean of X minus Mean of Y)

#### Solution

The summary statistics are

We then compute the pooled sample variance and t critical value corresponding to the 99% confidence limit:

From this, we see that the 99% margin of error is

This gives a confidence interval of

### Equivalence of Confidence Interval to Hypothesis Testing

We can use the confidence interval we have derived to test the hypothesis that the mean difference is zero. That is, we would like to test

using the test statistic

For a test having significance level

To unlock this lesson you must be a Study.com Member.

### Register to view this lesson

Are you a student or a teacher?

#### See for yourself why 30 million people use Study.com

##### Become a Study.com member and start learning now.
Back
What teachers are saying about Study.com

### Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.