A paired t-test compares two measurements that belong together, such as a before-and-after measurement on the same wafer. Instead of treating the two columns as independent groups, it first calculates one difference for each matched pair, then tests whether the average difference is zero.
The paired t-test formula
For each matched pair, define the difference using one consistent order, for example $d_i = \text{after}_i-\text{before}_i$. Let $\bar{d}$ be the mean of those differences, $s_d$ their sample standard deviation, and $n_{\text{pairs}}$ the number of complete pairs. The test statistic and degrees of freedom are:
Here, $\Delta_0$ is the hypothesized mean difference, usually zero. The standard error is $s_d/\sqrt{n_{\text{pairs}}}$, where the count is of pairs, not individual measurements. For the common two-sided test of no average change, use $\Delta_0=0$ and calculate $p=2P(T_{n_{\text{pairs}}-1}\ge |t|)$.
The corresponding two-sided $100(1-\alpha)\%$ confidence interval for the mean paired difference is:
If the interval excludes zero, it agrees with rejecting the zero-difference null hypothesis at that confidence level. The interval also shows the estimated direction and size of the change.
Worked example
Suppose five matched wafers have after-minus-before differences of $1,2,2,3,4$ units. Their mean difference is $\bar{d}=2.4$, sample standard deviation is $s_d\approx1.140$, and standard error is $1.140/\sqrt{5}\approx0.510$. The test gives $t=2.4/0.510\approx4.707$ with $\nu=5-1=4$ degrees of freedom. The two-sided p-value is approximately $0.0093$; the 95% confidence interval is approximately $[0.984,\,3.816]$ units. This example tests the mean of the five within-wafer changes, not a difference between two independent groups.
When the pairing is valid
- Each before measurement must be matched to the correct after measurement from the same unit or a pre-defined matched unit.
- The differences from distinct pairs should be independent of one another.
- The paired t-test assumes the differences are reasonably well modeled by a normal distribution, especially for small samples. Check the differences for strong outliers or severe skew; normality of each original column is not the condition being tested.
- Missing one side of a pair means that pair cannot contribute its within-pair difference. Do not silently treat unmatched measurements as pairs.
- The sign depends on the subtraction order. Reversing after-minus-before to before-minus-after reverses $t$ and the interval endpoints, but not a two-sided p-value.
Pairing improves precision when measurements from the same unit move together, because shared unit-to-unit variation can cancel in the differences. It does not automatically make a test more precise: use pairing only when the matches are real and valid.