Confidence interval of $\mu_1 – \mu_2$ of two samples

confidence intervalstatistics

We have two samples where both is $N(\mu_i, \sigma_i)$, we assume that $\sigma_1 = \sigma_2$. From the two samples we get the follow numbers:

$n_1 = 4, \bar{x} = 1007.25, s_1=143.66$ and $n_2 = 4, \bar{x}=817.25, s_2=73.627$

Calculate the lower limit of a confidence interval for $\mu_1 – \mu_2$ where the confidence level is 95%.

What I've done:

I calculated $s$ to be: $s=114,1471$. Then I use t-distribution: $\mu_1 – \mu_2 – \frac{s\cdot \lambda_{\frac{\alpha}{2}}(f)}{\sqrt{n}}$ which gives:
$1007.25 – 817.75 – \frac{s\cdot \lambda_{0.025}(6)}{\sqrt{8}} = 90.123$ which apparently is wrong. What am I doing wrong here?

The thing I feel most uncertain about here is what $f$ and $n$ is supposed to be when using two samples like this.

Best Answer

As we are dealing with unknown population variances, we need to first calculate the sample pooled variance, denoted by $$s_p^2=\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}$$ where the denominator is just the sum of $(n_1-1)$ and $(n_2-1)$. You can think of it as a weighted sum of the sample variances, $s_1$ and $s_2$.

Once this is calculated, the standard error is immediately $$\text{s.e.}=s_p\sqrt{\frac1{n_1}+\frac1{n_2}}$$ and you can obtain the lower limit of the $95\%$ confidence interval from $(\hat{\mu_1}-\hat{\mu_2})-t_{n_1+n_2-2,0.975}\,\text{s.e.}$

Note that $0.975=1-\frac{0.05}2$.


In your case where we have $n_1=n_2$, we get $\text{s.e.}=\sqrt{\dfrac{s_1^2+s_2^2}{n_1}}$.

Related Question