Paired Sample T-test: Mathematical Derivation of Paired T-test

Introduction

The paired sample t-test is a fundamental statistical method used to compare the means of two related groups, such as pre- and post-intervention measurements or within-subjects comparisons. This test assumes that the differences between the paired observations are normally distributed and that the samples are independent. The paired t-test is particularly useful when the same subjects are measured under two different conditions, allowing for the analysis of how the intervention affects the outcome. Unlike the independent samples t-test, the paired t-test accounts for the correlation between the two groups, reducing the variance and increasing the power of the test. The derivation of this test involves calculating the mean difference, standard deviation of the differences, and the test statistic under the null hypothesis, which follows a t-distribution.

Theoretical Foundation

Before delving into the mathematical derivation, it is essential to establish the assumptions and key concepts underlying the paired sample t-test. The primary assumption is that the differences between the paired observations are normally distributed, which is critical for the validity of the test. Additionally, the samples must be independent, meaning that the pairs are not randomly selected from the same population. The test also assumes that the variances of the differences are homogenous, although this assumption is less strict than in the independent samples t-test. The paired t-test is based on the concept of dependent samples, where each observation in one group is paired with an observation in the other group.

The mathematical derivation begins by defining the difference between the paired observations. Let $ X_{ij} $ denote the $ j $-th observation in the $ i $-th group, where $ i = 1, 2 $ and $ j = 1, 2, ..., n $. The difference $ D_{ij} = X_{ij} - X_{ji} $ represents the variation between the two groups. The mean difference $ \bar{D} $ is calculated as:
$$ \bar{D} = \frac{1}{n} \sum_{j=1}^{n} D_{ij} $$
The standard deviation of the differences $ s_D $ is given by:
$$ s_D = \sqrt{\frac{1}{n-1} \sum_{j=1}^{n} (D_{ij} - \bar{D})^2} $$
The test statistic $ t $ is then calculated as:
$$ t = \frac{\bar{D}}{s_D / \sqrt{n}} $$
This formula is analogous to the independent samples t-test, but the standard error $ s_D / \sqrt{n} $ accounts for the correlation between the paired observations. Under the null hypothesis, where $ \bar{D} = 0 $, the distribution of $ t $ follows a t-distribution with $ n-1 $ degrees of freedom.

Mathematical Derivation

The derivation of the paired t-test begins with the assumption of normality, which ensures that the distribution of the differences $ D_{ij} $ is approximately normal. The test statistic $ t $ is derived by considering the variance of the differences under the null hypothesis. The variance $ \sigma_D^2 $ of the differences is given by:
$$ \sigma_D^2 = \frac{\sigma_1^2 + \sigma_2^2 - 2\rho \sigma_1 \sigma_2}{n} $$
where $ \sigma_1^2 $ and $ \sigma_2^2 $ are the variances of the two groups, and $ \rho $ is the correlation coefficient between the paired observations. Under the null hypothesis, $ \rho = 0 $, simplifying the variance to:
$$ \sigma_D^2 = \frac{\sigma_1^2 + \sigma_2^2}{n} $$
This variance is then used to compute the standard error $ s_D / \sqrt{n} $, which is the denominator of the test statistic $ t $. The test statistic $ t $ is thus:
$$ t = \frac{\bar{D}}{s_D / \sqrt{n}} = \frac{\bar{D} \sqrt{n}}{s_D} $$
The derivation of the t-distribution under the null hypothesis involves recognizing that the differences $ D_{ij} $ are normally distributed, and their sum follows a normal distribution. The test statistic $ t $ is then distributed as a t-distribution with $ n-1 $ degrees of freedom, reflecting the reduced degrees of freedom due to the paired structure.

The mathematical derivation also involves the application of the central limit theorem, which states that the distribution of the sample mean converges to a normal distribution as the sample size increases. In the case of the paired t-test, the distribution of $ \bar{D} $ is normal if the individual differences $ D_{ij} $ are normally distributed. This allows the test statistic $ t $ to follow a t-distribution, which is more robust to deviations from normality than the z-test.

Hypothesis Testing

The paired sample t-test is conducted under the null hypothesis $ H_0: \mu_D = 0 $, where $ \mu_D $ is the mean difference between the paired observations. The alternative hypothesis $ H_1 $ can be one-sided (e.g., $ \mu_D > 0 $ or $ \mu_D < 0 $) or two-sided (e.g., $ \mu_D \neq 0 $). The rejection region for the test is determined by comparing the calculated $ t $-value to the critical values from the t-distribution table. If the absolute value of the test statistic $ |t| $ exceeds the critical value, the null hypothesis is rejected.

The decision rule for the paired t-test is based on the p-value, which is the probability of observing a test statistic as extreme as the calculated value under the null hypothesis. The