Tutorials › AP Statistics › The Form of a Two-Sample t Interval

Two-sample t confidence intervals · Tutorial 706 of 1000

The Form of a Two-Sample t Interval

Build and label a two-sample t interval, then interpret its center, margin of error, and endpoints in context.

Intermediate 9 min read

What You'll Learn

  • Write a two-sample t interval in the form sample difference plus or minus critical value times standard error.
  • Identify what each component estimates or represents, and keep its units clear.
  • Find the critical value using the confidence level and the selected degrees of freedom.
  • Calculate and interpret the margin of error and interval endpoints.
  • Check the conditions for a two-sample t interval and communicate the result in context.

From a Difference in Sample Means to an Interval

In “Standard Error for a Difference in Means,” you learned how to estimate the variability of \(\bar{x}_1-\bar{x}_2\) for two independent samples. In “Computing Two-Sample Degrees of Freedom With the Welch Formula,” you learned how the degrees of freedom help select a t distribution. Now combine those ingredients to estimate the difference between two population means.

A two-sample t confidence interval is centered at the observed difference in sample means. It extends a margin of error in each direction, where the margin of error is a t critical value multiplied by the standard error. The interval estimates \(\mu_1-\mu_2\), the true mean for population 1 minus the true mean for population 2.

Formula: For two independent samples, a confidence interval for \(\mu_1-\mu_2\) is \[ (\bar{x}_1-\bar{x}_2)\ \pm\ t^* SE_{\bar{x}_1-\bar{x}_2}, \qquad SE_{\bar{x}_1-\bar{x}_2}=\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}. \] Use the selected two-sample degrees of freedom to find \(t^*\).

The “plus or minus” form describes two endpoints: subtract the margin of error to get the lower endpoint, and add it to get the upper endpoint. Keep the subtraction order consistent. If sample 1 is subtracted from sample 2 instead, the interval is for \(\mu_2-\mu_1\), and its center and endpoints have the opposite signs.

Label Each Component

The formula is easier to use and explain when you can name what each part represents. The center is the difference observed in the samples; it is not itself the unknown population difference. The standard error measures the estimated sampling variability of that difference. The critical value sets how many standard errors to extend from the center for the chosen confidence level.

ComponentMeaning
\(\bar{x}_1-\bar{x}_2\)Observed difference between the sample means; the interval’s center.
\(SE_{\bar{x}_1-\bar{x}_2}\)Estimated standard deviation of the sampling distribution of the difference in sample means.
\(t^*\)Positive critical value selected from a t distribution using the confidence level and the chosen degrees of freedom.
\(t^* SE_{\bar{x}_1-\bar{x}_2}\)Margin of error: the distance from the center to either endpoint.
Lower and upper endpointsValues that form the interval estimate for \(\mu_1-\mu_2\), in the original variable’s units.

For a confidence level of \(C\), the total area in the two tails is \(\alpha=1-C\), so each tail has area \(\alpha/2\). Use \(t^*\) with upper-tail area \(\alpha/2\) and the degrees of freedom chosen for the procedure. As covered in the preceding degrees-of-freedom tutorial, that may be the calculator’s Welch value or the required conservative value \(\min(n_1-1,n_2-1)\). Use the method specified in the question, and keep it consistent.

The standard error and margin of error have the same units as the variable being measured. The critical value has no units. Therefore, the interval endpoints and the population mean difference have the original variable’s units as well.

Build the Interval Step by Step

1
Identify the parameter and order.
Define \(\mu_1-\mu_2\) in context, naming both populations and the variable. Keep that population order for the sample difference.
2
Check the conditions.
Confirm that the samples are independent random samples or come from an appropriate randomized process; check the 10% condition when sampling without replacement; and check that the data support using a t procedure.
3
Calculate the center and standard error.
Find \(\bar{x}_1-\bar{x}_2\) and \(\sqrt{s_1^2/n_1+s_2^2/n_2}\), keeping each group’s standard deviation with its own sample size.
4
Find \(t^*\), then calculate the margin of error.
Use the confidence level and selected degrees of freedom to find \(t^*\). Multiply it by the standard error.
5
Calculate and interpret the endpoints.
Subtract and add the margin of error to the sample difference. Interpret the interval as an estimate of the population mean difference in context.

These steps produce a two-sided interval: the same margin of error is added and subtracted from the center. A confidence interval is not a test conclusion by itself, but its location can help describe which population mean appears larger and which values for the difference are plausible.

Worked Examples

Worked Example: Comparing Two Production Lines

An invented quality-control comparison measures the operating time, in hours, of components from two production lines. Independent random samples give \(\bar{x}_1=54\), \(s_1=8\), and \(n_1=20\) for line 1; line 2 has \(\bar{x}_2=49\), \(s_2=6\), and \(n_2=16\). Construct a 95% confidence interval for the difference in the population mean operating times, using the conservative degrees-of-freedom method.

1
State.
Let \(\mu_1-\mu_2\) be the true difference in mean operating time, in hours, for components from line 1 minus line 2. We want a 95% confidence interval for this difference.
2
Plan and check conditions.
Use a two-sample t interval for independent means. The samples are described as independent random samples. Assume each sample is less than 10% of its production line’s components, so the 10% condition is satisfied. Suppose plots of operating times show no pronounced skewness or outliers in either sample. These checks support using a two-sample t interval.
3
Do.
Calculate the sample difference and standard error, then use the conservative degrees of freedom to find the critical value and margin of error.
4
Conclude.
Report the interval and interpret it as a plausible range for the true difference in population mean operating times, line 1 minus line 2.

The sample difference is \(54-49=5\) hours. The standard error is:

$$ SE_{\bar{x}_1-\bar{x}_2} = \sqrt{\frac{8^2}{20}+\frac{6^2}{16}} = \sqrt{3.2+2.25} = \sqrt{5.45} \approx 2.3345\text{ hours} $$

The conservative degrees of freedom are \(\min(20-1,16-1)=\min(19,15)=15\). For a 95% confidence level and \(df=15\), \(t^*\approx2.131\). Thus the margin of error is \(2.131(2.3345)\approx4.975\) hours, and the interval is:

$$ 5\pm4.975 \quad\Longrightarrow\quad (5-4.975,\ 5+4.975) \approx (0.025,\ 9.975)\text{ hours} $$

We are 95% confident that the true mean operating time for components from line 1 is about 0.025 to 9.975 hours greater than the true mean operating time for components from line 2. The interval is for \(\mu_1-\mu_2\), so positive values indicate a greater mean for line 1.

Worked Example: Identifying the Margin of Error

An invented study compares the time, in minutes, needed to complete a short online task using two interface designs. Independent random samples of 25 users per design give \(\bar{x}_1=72\), \(s_1=5\), \(\bar{x}_2=69.5\), and \(s_2=5\). Construct a 90% confidence interval for \(\mu_1-\mu_2\).

Assume the two groups are independent random samples, each sample is less than 10% of its respective population, and plots show no strong skewness or outliers. These conditions support a two-sample t interval. The center is \(72-69.5=2.5\) minutes. The standard error is:

$$ SE_{\bar{x}_1-\bar{x}_2} = \sqrt{\frac{5^2}{25}+\frac{5^2}{25}} = \sqrt{1+1} = \sqrt{2} \approx1.4142\text{ minutes} $$

Using the Welch degrees of freedom, each variance contribution is 1, so:

$$ df_{\text{Welch}} = \frac{(1+1)^2}{\frac{1^2}{24}+\frac{1^2}{24}} = \frac{4}{1/12} = 48 $$

For a 90% confidence level and \(df=48\), \(t^*\approx1.677\). The margin of error is \(1.677(1.4142)\approx2.372\) minutes. The interval is \(2.5\pm2.372\), or approximately \((0.128,\ 4.872)\) minutes. The center is the observed difference of 2.5 minutes; the margin of error is 2.372 minutes. We are 90% confident that the true mean task time for interface 1 is between 0.128 and 4.872 minutes greater than that for interface 2.

Worked Example: A Difference Centered Below Zero

An invented sports-science comparison measures recovery time, in minutes, for athletes following two different training routines. Independent random samples of 10 athletes per routine give \(\bar{x}_1=22.4\), \(s_1=3\), \(\bar{x}_2=24.0\), and \(s_2=3\). Construct a 95% confidence interval for \(\mu_1-\mu_2\).

Assume these are independent random samples, each is less than 10% of its target population, and plots of recovery times show no pronounced skewness or outliers. These checks support the two-sample t procedure. The sample difference, routine 1 minus routine 2, is \(22.4-24.0=-1.6\) minutes. The standard error is:

$$ SE_{\bar{x}_1-\bar{x}_2} = \sqrt{\frac{3^2}{10}+\frac{3^2}{10}} = \sqrt{0.9+0.9} = \sqrt{1.8} \approx1.3416\text{ minutes} $$

Welch’s formula gives \(df=18\), since the two variance contributions are both 0.9:

$$ df_{\text{Welch}} = \frac{(0.9+0.9)^2}{\frac{0.9^2}{9}+\frac{0.9^2}{9}} = \frac{3.24}{0.18} = 18 $$

For 95% confidence and \(df=18\), \(t^*\approx2.101\). The margin of error is \(2.101(1.3416)\approx2.819\) minutes. Therefore:

$$ -1.6\pm2.819 \quad\Longrightarrow\quad (-4.419,\ 1.219)\text{ minutes} $$

This interval includes zero, so the data are compatible with no difference in the population mean recovery times, as well as with differences in either direction. The negative center does not mean the calculation is wrong: it records that routine 1’s sample mean was 1.6 minutes lower than routine 2’s. The interval is for routine 1 minus routine 2, in minutes.

Common Mistakes and AP Exam Tips

  • Putting the groups in a different order halfway through: If the parameter is \(\mu_1-\mu_2\), the center must be \(\bar{x}_1-\bar{x}_2\). Define the order and retain it in the calculation and interpretation.
  • Using the wrong standard error: For independent samples, use \(\sqrt{s_1^2/n_1+s_2^2/n_2}\). Do not subtract standard deviations or treat the data as paired.
  • Confusing \(t^*\) with the margin of error: \(t^*\) is the critical value. The margin of error is \(t^*SE_{\bar{x}_1-\bar{x}_2}\), which has the variable’s units.
  • Using the confidence level to choose a one-tail critical value: A two-sided interval divides the remaining area between two tails. For 95% confidence, for example, each tail has area 0.025.
  • Reporting only the endpoints: Show the sample difference, standard error, critical value, and margin of error when asked to construct the interval. Label the interval’s units.
  • Interpreting the interval as a probability about a fixed parameter: A careful interpretation says, “We are 95% confident that the interval captures the true difference...” It does not say there is a 95% probability that this particular interval contains the parameter.

For full credit, show the interval formula with the correct sample difference and standard error, identify the confidence level and degrees-of-freedom method, and interpret both the population difference and its subtraction order in context. Keep enough digits during calculations and round the reported endpoints consistently.

Key takeaway: A two-sample t interval is the observed difference in sample means, \(\bar{x}_1-\bar{x}_2\), plus or minus \(t^*\) times its standard error. Label the center, critical value, standard error, margin of error, and endpoints, and interpret the result for \(\mu_1-\mu_2\) in context.

Check Your Understanding

For each question, identify the relevant interval component or explain the interpretation in context.

  1. In a two-sample interval for \(\mu_1-\mu_2\), what does \(\bar{x}_1-\bar{x}_2\) represent?
  2. If \(t^*=2.05\) and the standard error is 3.2 kilograms, calculate the margin of error and give its units.
  3. Why does a 95% two-sided t interval use a critical value with 0.025 in each tail?
  4. If the interval is for \(\mu_1-\mu_2\), what does a negative center say about the two sample means?
  5. Write one sentence that correctly interprets a 90% confidence interval of \((1.4,\ 5.8)\) minutes for a population mean difference in context, given that population 1 is subtracted from population 2.