Why Compare Two Population Means?
Many statistical questions compare the average outcomes of two populations: two production processes, two treatment groups, or two types of service. The parameter of interest is often the difference in population means. An interval estimate reports a range of plausible values for that difference while accounting for the sampling variation in both sample means.
This tutorial considers the specific case in which the two samples are independent, each population is normal, and both population variances are known. Under these assumptions, the difference between the sample means has a normal distribution with a known standard error. That makes an exact Z confidence interval available. The method is aligned with the SOA VEE Mathematical Statistics syllabus.
The Interval and Its Assumptions
For a two-sided confidence level of \(100(1-\alpha)\%\), let \(z_{1-\alpha/2}\) be the standard normal quantile with cumulative probability \(1-\alpha/2\). The interval is the observed difference in sample means plus and minus the critical value times the standard error.
The lower and upper endpoints, written separately, are
Here \(\sigma_1^2\) and \(\sigma_2^2\) are population variances, not sample variances. Their square roots are the population standard deviations. The sample sizes \(n_1\) and \(n_2\) can differ. The interval is centered at the estimated difference, and the margin of error is the critical value multiplied by the standard error.
The exact normal-theory result requires random samples from normal populations and independence both within and between the samples. The population variances must be known. If observations are paired, the independent-samples setup is not appropriate. If population variances are unknown, this known-variance Z formula does not apply; replacing them with sample variances changes the method.
Why the Standard Error Has This Form
A short variance calculation explains why the two contributions are added. The sample mean from the first population has variance \(\sigma_1^2/n_1\), and the sample mean from the second has variance \(\sigma_2^2/n_2\). For independent random variables, the variance of their difference is the sum of their variances: subtracting a random variable does not subtract its variance. Therefore, the variance of \(\bar{X}-\bar{Y}\) is \(\sigma_1^2/n_1+\sigma_2^2/n_2\), and its standard deviation is the square root of that sum.
Because each sample mean is normal and the samples are independent, their difference is also normal. Thus the standardized difference has a standard normal distribution:
The central \(1-\alpha\) probability of a standard normal distribution lies between \(-z_{1-\alpha/2}\) and \(z_{1-\alpha/2}\). Applying those bounds to the standardized difference and rearranging for \(\mu_1-\mu_2\) gives the stated interval. Its repeated-sampling coverage is \(1-\alpha\): across repeated samples under the model, that proportion of intervals would contain the fixed parameter.
Worked Calculations
Worked Example: Comparing Two Hypothetical Production Lines
A hypothetical quality study samples independent items from two normal production lines. The measured characteristic has known population variance \(16\) units squared for Line A and \(9\) units squared for Line B. The sample sizes are \(n_A=16\) and \(n_B=9\), and the observed sample means are \(52\) and \(47\) units. Construct a 95% confidence interval for \(\mu_A-\mu_B\).
Method and assumptions. Use the independent-samples known-variance Z interval. The samples are stated to be independent, the populations are normal, and the population variances are known. For 95% confidence, \(\alpha=0.05\), so \(z_{1-\alpha/2}=z_{0.975}=1.96\).
Step 1: Find the estimated difference. The order is A minus B because the requested parameter is \(\mu_A-\mu_B\):
Step 2: Find the standard error. Use variances in the formula, dividing each by its own sample size:
Step 3: Find the margin of error and endpoints. Keeping unrounded values until the final step,
The 95% interval is \((2.2281,\ 7.7719)\) units, rounded to four decimal places. In repeated use of this procedure, 95% of intervals would cover the difference in population means, assuming the model is correct.
Common mistake avoided: The variances are \(16\) and \(9\), so they are divided by the respective sample sizes directly. Taking square roots first and then dividing by sample size would give the wrong standard error.
Worked Example: A Negative Difference Is Still an Estimate
In a hypothetical study of two independent normal populations, the known variances are \(25\) and \(36\), and the sample sizes are \(25\) and \(36\), respectively. The observed sample means are \(42\) and \(45\). Construct a 90% confidence interval for \(\mu_1-\mu_2\).
Method. Use the two-sided known-variance Z interval, with the first population kept first throughout. A 90% interval has \(\alpha=0.10\), giving \(z_{0.95}\approx1.645\).
Step 1: Compute the sample-mean difference.
Step 2: Compute the standard error.
Step 3: Compute the margin and endpoints.
The 90% confidence interval is \((-5.3264,\ -0.6736)\), rounded to four decimal places. Since the entire interval is below zero, the values it supports for \(\mu_1-\mu_2\) are negative.
Common mistake avoided: A negative sample difference is not a reason to reverse the endpoints or take an absolute value. The interval stays centered at \(-3\), and its lower endpoint is the center minus the positive margin.
Worked Example: A Wider Interval at a Higher Confidence Level
A hypothetical assessment compares independent normal populations with known variances \(100\) and \(64\). The sample sizes are \(25\) and \(16\), and the observed sample means are \(108\) and \(102\). Find a 99% confidence interval for \(\mu_1-\mu_2\).
Method. Apply the known-variance Z interval. For a 99% two-sided interval, \(\alpha=0.01\) and \(z_{0.995}\approx2.576\).
Step 1: Compute the observed difference.
Step 2: Compute the standard error using each population variance and sample size.
Step 3: Compute the margin and interval.
The 99% interval is \((-1.2860,\ 13.2860)\), rounded to four decimal places. It includes zero, so this interval does not rule out equal population means. Compared with a lower-confidence interval using the same data, the higher critical value produces a wider interval.
Common mistake avoided: A high confidence level uses a larger, not smaller, critical value. The 99% critical value is approximately \(2.576\), rather than the 95% value \(1.96\).
Keep the Sign Convention Consistent
A difference is meaningful only after its order is specified. If the target is \(\mu_1-\mu_2\), the interval must be centered at \(\bar{x}_1-\bar{x}_2\). If the target is instead \(\mu_2-\mu_1\), reverse the sample-mean order; the resulting interval has the same width but endpoints that are the negatives of the original endpoints in reverse order.
For example, if an interval for \(\mu_1-\mu_2\) is \((L,U)\), then the corresponding interval for \(\mu_2-\mu_1\) is \((-U,-L)\). The standard error does not change because the variance of a difference is unchanged when its sign is reversed.
Common Exam Traps
- Using standard deviations where variances are required. The formula contains \(\sigma_1^2/n_1+\sigma_2^2/n_2\). If the problem gives standard deviations, square each one before dividing.
- Using the wrong sample size for a variance. Pair the first population variance with \(n_1\), and the second with \(n_2\). Do not divide both by one sample size.
- Subtracting standard errors. Independent samples contribute variances that add. The standard error is the square root of the sum, not the difference between two quantities.
- Changing the sign convention midway. A request for \(\mu_1-\mu_2\) requires \(\bar{x}_1-\bar{x}_2\), including when that estimate is negative.
- Using this exact Z interval when the assumptions are absent. It requires known population variances, normal populations, and independent samples. A paired design or unknown population variances calls for a different method.
Check Your Understanding
For each problem, identify the requested order of the mean difference before calculating. Round interval endpoints to four decimal places.
- Two independent normal populations have known variances \(9\) and \(16\), sample sizes \(9\) and \(16\), and sample means \(31\) and \(28\). Find a 95% interval for \(\mu_1-\mu_2\). (Answer: \((0.2281,\ 5.7719)\))
- Independent normal samples have known variances \(4\) and \(9\), sample sizes \(16\) and \(9\), and sample means \(12.4\) and \(14.1\). Find a 90% interval for \(\mu_1-\mu_2\). (Answer: \((-3.5392,\ 0.1392)\))
- For independent normal populations, \(\sigma_1^2=16\), \(\sigma_2^2=25\), \(n_1=64\), \(n_2=25\), and the sample means are \(80\) and \(74\). Find a 99% interval for \(\mu_1-\mu_2\). (Answer: \((3.1199,\ 8.8801)\))
- Two independent normal populations have known variances \(49\) and \(25\), sample sizes \(49\) and \(25\), and sample means \(18.5\) and \(21.0\). Find a 95% interval for \(\mu_1-\mu_2\). (Answer: \((-5.2719,\ 0.2719)\))
- Independent normal samples have known variances \(36\) and \(64\), sample sizes \(36\) and \(16\), and sample means \(56\) and \(52\). Find a 90% interval for \(\mu_1-\mu_2\). (Answer: \((0.3217,\ 7.6783)\))