From Sampling Distribution to Standard Error
In “Sampling Distribution of \(\bar{x}_1-\bar{x}_2\),” we described how the difference between two independent sample means varies from sample to sample. Its theoretical standard deviation depends on the population standard deviations, \(\sigma_1\) and \(\sigma_2\). In practice, those population values are usually unknown. We estimate the spread using the sample standard deviations, \(s_1\) and \(s_2\).
This estimated spread is called the standard error of the difference in sample means. It describes the typical sample-to-sample variability in \(\bar{x}_1-\bar{x}_2\), estimated from the data. In this tutorial, we focus on calculating it carefully. It is one ingredient in a two-sample t confidence interval.
Use \(n_1\) and \(n_2\) for the sample sizes and \(s_1\) and \(s_2\) for the sample standard deviations. The formula is:
The expression inside the square root has two parts. The first, \(s_1^2/n_1\), estimates the contribution of sample 1 to the variance of the difference. The second, \(s_2^2/n_2\), estimates the contribution from sample 2. Because the samples are independent, these estimated variances are added. The square root converts the result back to the units of the original quantitative variable.
The subtraction order used to define \(\bar{x}_1-\bar{x}_2\) does not change the standard error: reversing the groups leaves the same two terms being added. However, the order does change the sign of the observed difference and the population difference it estimates. As in “Comparing Two Means: The Parameter of Interest,” state clearly which population is group 1 and which is group 2.
How to Calculate the Standard Error
A reliable calculation keeps the two groups separate until the final addition. First square each sample standard deviation. Divide each squared value by its own group’s sample size. Add those two results, then take the square root. The sample standard deviation is not divided directly by the sample size; its square is divided by the sample size.
Record \(s_1\), \(n_1\), \(s_2\), and \(n_2\), matching each standard deviation to its own sample size.
Find \(s_1^2/n_1\) and \(s_2^2/n_2\) separately.
The sum estimates the variance of the difference in sample means.
The result is the estimated standard error, in the same units as the original measurements.
The formula resembles the theoretical standard deviation in the previous tutorial, but the symbols have an important difference. The theoretical formula uses population standard deviations, \(\sigma_1\) and \(\sigma_2\); the standard error uses the sample estimates \(s_1\) and \(s_2\). The standard error is therefore an estimate, not a known population quantity.
Worked Examples
Worked Example: Comparing Seedling Heights
A greenhouse compares the heights of seedlings grown under two lighting systems. Let group 1 be seedlings under the first system and group 2 seedlings under the second. In an invented example, the first independent sample has \(n_1=36\) seedlings and sample standard deviation \(s_1=12\) centimeters. The second has \(n_2=25\) seedlings and \(s_2=9\) centimeters. Calculate the standard error of \(\bar{x}_1-\bar{x}_2\).
First calculate the contribution from each group:
Add the contributions and take the square root:
A check using the rounded result gives \(2.6907^2\approx7.2399\), which is approximately 7.24; the tiny difference is due to rounding. The estimated standard error is about 2.6907 centimeters. In repeated sampling under comparable conditions, differences between the two sample means would typically vary around the population mean difference by roughly this amount. This does not mean the observed difference must be within 2.6907 centimeters of the population difference.
Worked Example: Comparing Travel Times
A transportation class compares the travel times, in minutes, for two independent groups of commuters using different routes. Suppose group 1 has \(n_1=25\) commuters and \(s_1=18\) minutes; group 2 has \(n_2=16\) commuters and \(s_2=12\) minutes. Find the standard error of the difference in sample mean travel times, with group 1’s mean first.
Square and divide within each group. For group 1, \(18^2=324\), and \(324/25=12.96\). For group 2, \(12^2=144\), and \(144/16=9\). Thus:
To check, \(4.686^2=21.958596\), which rounds to 21.96; the unrounded square root is approximately 4.68615 minutes. So the standard error rounded to three decimal places is 4.686 minutes. Notice that the result is not \(18/25+12/16\), and it is not the average of 18 and 12. Each group’s squared standard deviation must be divided by its own sample size before the terms are added.
Worked Example: Different Variability and Sample Sizes
A school survey compares the number of minutes students spend using two study apps each evening. In this invented example, group 1 has \(n_1=25\) students and sample standard deviation \(s_1=5\) minutes. Group 2 has \(n_2=64\) students and sample standard deviation \(s_2=8\) minutes. Calculate and interpret the standard error of \(\bar{x}_1-\bar{x}_2\).
The first group’s contribution is \(5^2/25=25/25=1\) minute squared. The second group’s contribution is \(8^2/64=64/64=1\) minute squared. Therefore:
As a numerical check, \(1.4142^2\approx1.99996\), which is approximately 2. The standard error is about 1.4142 minutes. Although group 2 has the larger sample standard deviation, it also has a larger sample size, so its variance contribution is equal to group 1’s in this example. This illustrates why the calculation must account for both \(s\) and \(n\) in each group, not just compare standard deviations.
What the Standard Error Tells You
The standard error describes the estimated spread of the sampling distribution of \(\bar{x}_1-\bar{x}_2\). It is measured in the same units as the variable: centimeters for heights, minutes for times, and so on. It is not the standard deviation of individual observations pooled across both groups. It is also not the observed difference between the sample means.
A smaller standard error means the difference in sample means would generally be less variable from sample to sample, if the populations and sampling plans stayed the same. Increasing a sample size reduces that group’s variance contribution, since \(s_i^2/n_i\) becomes smaller when \(n_i\) increases and \(s_i\) is held fixed. A larger sample mean, by itself, does not reduce the standard error.
Each sample size matters separately. A large \(n_1\) reduces the first contribution, but it does not automatically reduce the second contribution. The effect of increasing a group’s sample size is greatest when that group’s contribution is a substantial part of the total variance. Do not replace \(n_1\) and \(n_2\) with their sum in the formula.
The standard error is an estimate based on the observed sample standard deviations. A different sample could produce different \(s_1\), \(s_2\), and therefore a different standard error. The calculation alone does not establish whether a two-sample t procedure is appropriate; the samples must also meet the relevant design and distribution conditions. “Identifying Two Independent Samples” discusses the design distinction between independent and paired data.
Common Mistakes and AP Exam Tips
- Forgetting to square the sample standard deviations: The terms are \(s_1^2/n_1\) and \(s_2^2/n_2\). Writing \(s_1/n_1\) and \(s_2/n_2\) gives the wrong calculation and units.
- Subtracting the two contributions: Add the estimated variance contributions for independent samples, then take the square root.
- Pairing the wrong sample size with a standard deviation: Keep each group’s values together. Use \(s_1^2/n_1\) and \(s_2^2/n_2\), not a cross-pairing.
- Taking the square root too early: Find both variance contributions, add them, and only then take one square root. Do not take separate square roots and add them.
- Confusing the standard error with an observed difference: The standard error is an estimated measure of variability, not \(\bar{x}_1-\bar{x}_2\) itself.
- Reporting squared units: The terms under the radical are in squared units, but the standard error is in the original units after taking the square root.
- Claiming that a larger sample mean lowers the standard error: The sample size affects the standard error through the denominator. The numerical value of a sample mean is not part of this formula.
For a clear AP response, show the formula, substitute each group’s \(s\) and \(n\), show the two contributions and their sum, and report the square root with units. A complete calculation makes it possible to see that the correct sample sizes were used and that the variance terms were added. Keep the group order clear when describing \(\bar{x}_1-\bar{x}_2\), even though reversing that order would leave the standard error unchanged.
Check Your Understanding
For each question, show the variance contributions and include units in your answer.
- Independent samples have \(s_1=10\), \(n_1=25\), \(s_2=6\), and \(n_2=9\). Calculate the standard error of \(\bar{x}_1-\bar{x}_2\).
- Two groups have standard deviations of 4 kilograms and 7 kilograms, with sample sizes 16 and 49, respectively. What is the estimated standard error of the difference in sample means?
- Why does reversing the order of the groups change the sign of the observed difference but not its standard error?
- A student calculates \(s_1/n_1+s_2/n_2\). Identify the error and write the correct formula.
- If \(s_1\) and \(s_2\) stay fixed while \(n_1\) increases, which term in the standard error formula changes, and in what direction?