A **confidence interval (C.I.) for a difference between means **is a range of values that is likely to contain the true difference between two population means with a certain level of confidence.

This tutorial explains the following:

- The motivation for creating this confidence interval.
- The formula to create this confidence interval.
- An example of how to calculate this confidence interval.
- How to interpret this confidence interval.

**C.I. for the Difference Between Means: Motivation**

Often researchers are interested in estimating the difference between two population means. To estimate this difference, they’ll go out and gather a random sample from each population and calculate the mean for each sample. Then, they can compare the difference between the two means.

However, they can’t know for sure if the difference in the sample means matches the true difference in the population means which is why they may create a confidence interval for the difference between the two means. This provides a range of values that is likely to contain the true difference between the population means.

For example, suppose we want to estimate the difference in mean weight between two different species of turtles. Since there are thousands of turtles in each population, it would be too time-consuming and costly to go around and weigh each individual turtle.

Instead, we might take a simple random sample of 15 turtles from each population and use the mean weight in each sample to estimate the true difference in mean weight between the two populations:

The problem is that our samples are random, so the difference in mean weights between the two samples is not guaranteed to exactly match the difference in mean weights between the two populations. So, to capture this uncertainty we can create a confidence interval that contains a range of values that are likely to contain the true difference in mean weight between the two populations.

**C.I. for the Difference Between Means:**** Formula**

We use the following formula to calculate a confidence interval for a difference between two means:

**Confidence interval** = (x_{1}–x_{2}) +/- t*√((s_{p}^{2}/n_{1}) + (s_{p}^{2}/n_{2}))

where:

- x
_{1}, x_{2}: sample 1 mean, sample 2 mean - t: the t-critical value based on the confidence level and (n
_{1}+n_{2}-2) degrees of freedom - s
_{p}^{2}: pooled variance - n
_{1}, n_{2}: sample 1 size, sample 2 size

where:

- The pooled variance is calculated as:
**s**= ((n_{p}^{2}_{1}-1)s_{1}^{2}+ (n_{2}-1)s_{2}^{2}) / (n_{1}+n_{2}-2) - The t-critical value
**t**can be found using the Inverse t Distribution calculator

**C.I. for the Difference Between Means: ****Example**

Suppose we want to estimate the difference in mean weight between two different species of turtles, so we go out and gather a random sample of 15 turtles from each population. Here is the summary data for each sample:

**Sample 1:**

- x
_{1}= 310 - s
_{1}= 18.5 - n
_{1}= 15

**Sample 2:**

- x
_{2}= 300 - s
_{2}= 16.4 - n
_{2}= 15

Here is how to find various confidence intervals for the true difference in population mean weights:

**90% Confidence Interval:**

(310-300) +/- 1.70*√((305.61/15) + (305.61/15)) =** [-0.8589, 20.8589]
**

**95% Confidence Interval:**

(310-300) +/- 2.05*√((305.61/15) + (305.61/15)) =** [-3.0757, 23.0757]
**

**99% Confidence Interval:**

(310-300) +/- 2.76*√((305.61/15) + (305.61/15)) =** [-7.6389, 27.6389]
**

**Note: **You can also find these confidence intervals by using the Statology Confidence Interval for the Difference Between Means Calculator.

You’ll notice that the higher the confidence level, the wider the confidence interval. This should make sense because wider intervals are more likely to contain the true population mean, thus we’re more “confident” that the interval contains the true population mean.

**C.I. for the Difference Between Means****: Interpretation**

The way we would interpret a confidence interval is as follows:

There is a 95% chance that the confidence interval of [-3.0757, 23.0757] contains the true difference in mean weight between the two turtle populations.

Since this interval contains the value “0” it means that it’s possible that there is no difference in the mean weight between the turtles in these two populations. In other words, we cannot say with 95% confidence that there is a difference in mean weight between the turtles in these two populations.