Wiki Page, Math 13 - Perez Sandbox : Module 25 - Estimating the Difference in Two Population Means

Wiki Page
2026-01-17T21:15:43-08:00

Confidence Interval to Estimate the Difference Between Two Means

In a hypothesis test, when the sample evidence leads us to reject the null hypothesis, we conclude that the population means differ or that one is larger than the other. An obvious next question is how much larger? In practice, when the sample mean difference is statistically significant, our next step is often to calculate a confidence interval to estimate the size of the difference in the population means.

The confidence interval gives us a range of reasonable values for the difference in population means . We call this the two-sample T-interval or the confidence interval to estimate a difference in two population means. The form of the confidence interval is similar to others we have seen.

(sample statistic) (margin of error)

(sample statistic) (critical T-value)(standard error)

We outline the familiar parts of the confidence interval below, including formulas, but we will not require you to calculate a confidence interval by hand. We will use StatCrunch.That said, you will better understand the StatCrunch print-out if you understand the information about the confidence interval given below.

Sample Statistic

Since we’re estimating the difference between two population means, the sample statistic is the difference between the means of the two independent samples: .

Critical T-Value

The critical T-value comes from the T-model, just as it did in "Estimating a Population Mean." Again, this value depends on the degrees of freedom . For two-sample T-test or two-sample T-intervals, the value is based on a complicated formula that we do not cover in this course. We will leave this calculation of degrees of freedom to StatCrunch.

Standard Error

The estimated standard error for the two-sample T-interval is the same formula we used for the two-sample T-test. (As usual, and denote the sample standard deviations, and and denote the sample sizes.). As always, the standard error is a measure of the average amount of error (aka standard deviation) in the sampling distribution of differences in sample means.

Confidence Interval

Putting all this together gives us the following formula for the two-sample T-interval.

Conditions for Use

The conditions for using this two-sample T-interval are the same as the conditions for using the two-sample T-test.

The two random samples are independent and representative.

The variable is normally distributed in both populations. If it is not known, samples of more than 30 will have a difference in sample means that can be modeled adequately by the T-distribution. As we discussed previously, T-procedures are robust even when the variable is not normally distributed in the population. If checking normality in the populations is impossible, then we look at the distribution in the samples. If a histogram or dotplot or boxplot of the data does not show extreme skew or outliers, we take it as a sign that the variable is not heavily skewed in the populations, and we use the inference procedure based on the T-model.

EXAMPLE Confidence interval for the “calories and context” study

Previously, we worked through a hypothesis for the difference in two population means in the “calories and context” example. We concluded that at Indiana University of Pennsylvania, the mean number of calories ordered by undergraduate women eating with other women is greater than the mean number of calories ordered by undergraduate women eating with men (P-value = 0.0385).

In this example, we use the same sample data to estimate difference in the population means at the 90% confidence level.

Population 1: Let be the mean number of calories purchased by women eating with other women.

Population 2: Let be the mean number of calories purchased by women eating with men.

The conditions for use of the T-model are the same for the hypothesis test and the confidence interval for the difference in two population means. We verified that the conditions are met for use of the T-model when we conducted the hypothesis test previously.

Sample Statistics

Sample Statistics

| Size (n) | Mean ( ) | Std. Dev. (s)
Sample 1 | 45 | 850 | 252
Sample 2 | 27 | 719 | 322

Here is the StatCrunch print-out.

Two sample T summary confidence interval:
: Mean of population 1
: Mean of population 2
: Difference between two means
(without pooled variances)

90% confidence interval results:

Difference | Sample Diff. | Std. Err. | DF | L. Limit | U. Limit
| 131 | 72.466186 | 45.027286 | 9.299517 | 252.70015

To produce this StatCrunch print-out, follow the same steps as for the hypothesis test: Open an empty StatCrunch spreadsheet. Choose Stat, T Stats, Two Sample, with Summary. Enter the summary statistics provided in the table. Click confidence interval and enter the confidence level if different from the default of 0.95.

Interpretation

Here is the basic interpretation. We are 90% confident that the true value of is between 9 and 253 calories. Because the values are positive, this interval estimates that is greater than ; more specifically, is between 9 and 253 calories greater than .

However, we should be more specific about the populations. We are 90% confident that at Indiana University of Pennsylvania, undergraduate women eating with women order between 9 and 253 more calories than undergraduate women eating with men.

For those who like formulas, here are the calculations. We will not require you to compute confidence intervals for the difference in two population means by hand. We will use StatCrunch.

Standard Error

We found that the standard error of the sampling distribution of all sample differences is approximately 72.47.

Critical T-value

For these two independent samples, . We find the critical T-value using the same Inverse T-Distribution applet we used previously with a central probability of 0.9 (90%). Here is picture of our results.

Reading from the applet, we see that the critical T-value is approximately 1.6794.

Confidence Interval

We can now put all this together to compute the confidence interval:

Expressing this as an interval gives us:

This matches the lower and upper limit on the StatCrunch confidence interval shown in the print-out above.

Comment

In the previous example, because the values are positive, the confidence interval estimates that is greater than ; more specifically, is between 9 and 253 calories greater than .

Similarly, when a confidence interval contains only negative values, we estimate that is larger than by the amounts described in the interval.

When a confidence interval for contains both negative and positive values, it also contains 0. This tells us that could equal , which supports the null hypothesis.