What is the confidence interval for the difference between two means?

A confidence interval for the difference between two means is a statistical measurement that provides a range of values in which the true difference between the means of two populations is likely to fall within. It is calculated using sample data from both populations and takes into account the variability of the data. This interval is used to estimate the true difference between the two means with a certain level of confidence, typically 95%. It is a useful tool in comparing two populations and determining if there is a significant difference between their means.

Confidence Interval for the Difference Between Means


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 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 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:

Confidence interval for a difference between two population means

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 = (x1x2) +/- t*√((sp2/n1) + (sp2/n2))

where:

  • x1x2: sample 1 mean, sample 2 mean
  • t: the t-critical value based on the confidence level and (n1+n2-2) degrees of freedom
  • sp2: pooled variance
  • n1, n2: sample 1 size, sample 2 size

where:

  • The pooled variance is calculated as: sp2 = ((n1-1)s12 + (n2-1)s22) / (n1+n2-2)
  • The t-critical value can be found using

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:

  • x1 = 310
  • s1 = 18.5
  • n1 = 15

Sample 2:

  • x2 = 300
  • s2 = 16.4
  • n2 = 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 .

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.

x