Theoretical Background: Confidence Intervals for Two Independent Samples
When comparing the means of two independent populations (e.g., comparing the effectiveness of a new drug against a placebo, or academic performance of students from two different teaching methods), we often want to estimate the difference between their population means, \(\mu_1 - \mu_2\). A confidence interval provides a range of plausible values for this difference.
Key Inputs and Point Estimate
For two independent samples, we collect the following summary statistics:
- Sample 1: Sample mean (\(\bar{x}_1\)), sample standard deviation (\(s_1\)), sample size (\(n_1\)).
- Sample 2: Sample mean (\(\bar{x}_2\)), sample standard deviation (\(s_2\)), sample size (\(n_2\)).
The point estimate for the difference between the two population means \(\mu_1 - \mu_2\) is the difference between the sample means: \(\bar{x}_1 - \bar{x}_2\).
Checking for Equality of Variances (F-Test)
An important consideration is whether the variances of the two populations (\(\sigma_1^2\) and \(\sigma_2^2\)) can be assumed to be equal. This assumption affects the formula used for the confidence interval. An F-test is commonly used to check this assumption.
The null hypothesis is \(H_0: \sigma_1^2 = \sigma_2^2\) (variances are equal) and the alternative is \(H_a: \sigma_1^2 \neq \sigma_2^2\) (variances are not equal).
The F-statistic is calculated as the ratio of the sample variances. To simplify p-value calculation from standard F-tables or functions (which often give one-tailed probabilities), it's common to put the larger sample variance in the numerator:
This statistic follows an F-distribution with \(df_{num}\) (degrees of freedom for the numerator variance) and \(df_{den}\) (degrees of freedom for the denominator variance). For a two-tailed test, the p-value is \(2 \times P(F_{df_{num}, df_{den}} \ge F_{calculated})\).
If the p-value of the F-test is less than the chosen significance level (e.g., \(\alpha = 0.05\)), we reject \(H_0\) and conclude that the variances are likely different. Otherwise, we do not have enough evidence to say they are different.
Case 1: Population Variances Assumed Equal (Pooled t-Interval)
If we assume \(\sigma_1^2 = \sigma_2^2\) (often based on the F-test not being significant, or prior knowledge), we calculate a pooled (combined) estimate of the common variance, \(s_p^2\):
The standard error of the difference between the means is:
The confidence interval is then constructed using a t-distribution with \(df = n_1+n_2-2\) degrees of freedom:
This method is generally more powerful if the assumption of equal variances is correct.
Case 2: Population Variances Not Assumed Equal (Welch's t-Interval)
If we cannot assume \(\sigma_1^2 = \sigma_2^2\) (e.g., F-test is significant), Welch's t-test (or Welch's interval) is more appropriate. It does not require the assumption of equal variances.
The standard error of the difference between the means is:
The degrees of freedom for Welch's t-interval are approximated by the Welch-Satterthwaite equation:
This \(df\) value is often not an integer and is typically rounded down for a more conservative interval, though statistical software can use the fractional value.
The confidence interval is:
Welch's method is generally robust and recommended if there is doubt about the equality of variances.
Interpreting the Confidence Interval for the Difference
A \( (1-\alpha) \times 100\% \) confidence interval for \(\mu_1 - \mu_2\) is interpreted as: "We are \( (1-\alpha) \times 100\% \) confident that the true difference between the population means, \(\mu_1 - \mu_2\), lies between the lower bound and the upper bound of the interval."
A key aspect of interpreting this interval is to check if it contains zero:
- If the interval contains zero: This suggests that zero is a plausible value for the difference \(\mu_1 - \mu_2\). Therefore, there is not enough evidence at the \( (1-\alpha) \times 100\% \) confidence level to conclude that there is a significant difference between the two population means.
- If the interval does not contain zero:
- If both bounds are positive, it suggests \(\mu_1 > \mu_2\).
- If both bounds are negative, it suggests \(\mu_1 < \mu_2\).
Assumptions for Two-Sample t-Procedures
- Independence of Samples: The two samples must be independent of each other.
- Random Sampling: Data in each sample should be drawn randomly from their respective populations.
- Normality: Both populations from which the samples are drawn should be approximately normally distributed, OR both sample sizes (\(n_1\) and \(n_2\)) should be sufficiently large (e.g., \(n_1 \ge 30\) and \(n_2 \ge 30\)) for the Central Limit Theorem to apply to the sampling distribution of the difference in means. t-procedures are reasonably robust to violations of normality, especially with larger sample sizes.
The choice between the pooled t-procedure and Welch's t-procedure hinges on the assumption of equal population variances, which can be assessed using the F-test or prior knowledge.