Confidence Interval for paired t-test
Let $X_1, X_2, \cdots, X_n$ and $Y_1, Y_2, \cdots, Y_n$ be two dependent samples each of size $n$ with respective means $\mu_1$ and $\mu_2$. Define $d_i = X_i - Y_i$, $i=1,2,\cdots, n$. Let $\overline{d}=\frac{1}{n} \sum d_i$ be the mean of the difference and $s_d=\sqrt{\frac{1}{n-1}\sum (d_i - \overline{d})^2}$ be the sample standard deviation of the difference.
Let $C=1-\alpha$ be the confidence coefficient. Our aim is to construct $100(1-\alpha)$% confidence interval estimate of the mean of the differences from dependent samples.
The margin of error is
$$ \begin{aligned} E &= t_{(\alpha/2,n-1)} \frac{s_d}{\sqrt{n}}. \end{aligned} $$
where $t_{(\alpha/2,n-1)}$ is the value from $t$ statistical table for desired confidence level and degrees of freedom.
Then $100(1-\alpha)$% confidence interval for the mean of the difference is
$$ \begin{aligned} & \overline{d} - E \leq \mu \leq \overline{d} + E. \end{aligned} $$
Assumptions
a. The two samples are dependent (matched pairs).
b. Both the samples are simple random sample.
c. The two samples are both large ($n_1 > 30$ and $n_2 >30$) or both the samples comes from population having normal distribution.
Step by Step Procedure
Step by step procedure to estimate the confidence interval for difference between two population means for dependent samples is as follows:
Step 1 Specify the confidence level $(1-\alpha)$
Step 2 Given information
Specify the given information, sample size $n$, sample mean value of the difference $\overline{d}$ and the sample standard deviation $s_d$.
Step 3 Specify the formula
$100(1-\alpha)$% confidence interval for the mean of the difference is
$$ \begin{aligned} \overline{d} - E \leq \mu \leq \overline{d} + E. \end{aligned} $$
where $E = t_{(\alpha/2,n-1)} \frac{s_d}{\sqrt{n}}$.
Step 4 Determine the critical value
Determine the critical value $t_{(\alpha/2,n-1)}$ that corresponds to the desired confidence level.
Step 5 Compute the margin of error
The margin of error is
$$ \begin{aligned} E = t_{(\alpha/2,n-1)} \frac{s_d}{\sqrt{n}}. \end{aligned} $$
Step 6 Determine the confidence interval
$100(1-\alpha)$% confidence interval estimate for the mean of the difference is
$$ \begin{aligned} \overline{d} - E \leq \mu\leq \overline{d} + E \end{aligned} $$
Equivalently, $100(1-\alpha)$% confidence interval estimate of the mean of the difference is $\overline{d} \pm E$ or $(\overline{d} -E, \overline{d} +E)$.