In the above cases, we assumed that the samples are independent. However, sometimes the samples may not be independent.

If the samples are not independent, a test of mean difference is done using paired observations. Such a test is called paired comparison test.

- H
_{0}: µ_{d}= µ_{d0}versus H_{A}: µ_{d}≠ µ_{d0} - H
_{0}: µ_{d}≤ µ_{d0}versus H_{A}: µ_{d}> µ_{d0} - H
_{0}: µ_{d}≥ µ_{d0}versus H_{A}: µ_{d}< µ_{d0}

In the first hypothesis we want to test if the mean of the differences in pairs is zero.

µ_{d} is the mean of the population of paired differences.

µ_{d0} is the hypothesized value of mean of paired differences. This is usually assumed to be zero.

**Calculating t-statistic**

To calculate the *t*-statistic, we first need to find the sample mean difference:

The sample variance is:

The standard deviation of the mean is:

The test statistic, with n – 1 df is: