## CI for difference between two population means (variances are unknown)

Let $x_1, x_2, \cdots, x_{n_1}$ be a random sample of size $n_1$ from a population with mean $\mu_1$ and standard deviation $\sigma_1$.

Let $y_1, y_2, \cdots, y_{n_2}$ be a random sample of size $n_2$ from a population with mean $\mu_2$ and standard deviation $\sigma_2$. The two sample are independent. Assume that the standard deviations are unknown but equal.

## Formula

$100(1-\alpha)$% confidence interval estimate for the difference $(\mu_1-\mu_2)$ is

### $(\overline{x} -\overline{y})- E \leq (\mu_1-\mu_2) \leq (\overline{x} -\overline{y}) + E$

where,

• $1-\alpha$ is the confidence coefficient,
• $\overline{x} = \dfrac{1}{n_1}\sum x_i$ is the sample mean of first sample,
• $\overline{y} = \dfrac{1}{n_2}\sum y_i$ is the sample mean second sample,
• $E = t_{\alpha/2,n_1+n_2-2} s_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}$ is the margin of error,
• $t_{\alpha/2,n_1+n_2-2}$ is the critical value of $t$,
• $s_1^2 = \dfrac{1}{n_1-1}\sum (x_i -\overline{x})^2$ is the sample variance of first sample,
• $s_2^2 = \dfrac{1}{n_2-1}\sum (y_i -\overline{y})^2$ is the the sample variance of second sample,
• $s_p=\sqrt{\dfrac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}}$ be the pooled standard deviation.