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

Sample 1


Sample 2

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,

Probability inequality

explanation of A and B and alpha

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

T formula

In the formula of T, we have defined:

Explanation of pooled variance

Sample means


difference in means delta

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

equality in distribution for Z


Sample variances distribution

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,

Distribution Equality for T


Distribution of ratio variables

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

Statement one equivalence

is equivalent to

Confidence Interval


Confidence interval formula

This means that the random interval

Random interval for mean difference

Interpretation of 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

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


We are constructing a confidence interval for the parameter

Difference notation for example 1

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

Sample Means Example 1

Summary statistics Example 1

Therefore the pooled sample variance is

Pooled Example 1

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

Critical Value Example 1

So the margin of error is

Margin of Error Example 1

The 95% confidence interval is then

Confidence Interval Example 1

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

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)


The summary statistics are

Summary Statistics Example 2

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

Pooled And CV Example 2

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

ME Example 2

This gives a confidence interval of

CI example 2

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

Hypothesis Test

using the test statistic

Test Statistic

For a test having significance level

significance level

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

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.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account