Tutorials › VEE Mathematical Statistics › Paired t Tests for Matched Observations

VEE Mathematical Statistics · Classical Tests and Goodness of Fit · Tutorial 681 of 880

Paired t Tests for Matched Observations

Use within-pair differences to test a mean change or contrast while accounting for the dependence between matched observations.

Intermediate 11 min read

What You'll Learn

  • Define a difference in a consistent direction for every matched pair
  • State the assumptions that justify an exact paired t procedure
  • Calculate the paired t statistic, degrees of freedom, and decision
  • Connect a two-sided paired test with a confidence interval
  • Recognize why treating matched observations as independent can mislead

Why Pairing Changes the Analysis

When two measurements come from the same person, object, or deliberately matched subjects, they are generally related. A before-and-after study, for example, records two observations on each person. The statistical question is often about the average change, not about comparing two unrelated collections of measurements. A paired t test answers that question by first reducing each pair to one difference and then applying a one-sample t procedure to the differences.

Pairing can remove some variation associated with differences between subjects: a person who tends to score highly on both occasions may have a small within-person change. The procedure is useful only when the pairs are meaningful and the difference is defined consistently. It does not, by itself, establish that an intervention caused an observed change.

Definition: For pair \(i\), let \(X_i\) be the first measurement and \(Y_i\) the second. Choose a direction and define the within-pair difference \(D_i=X_i-Y_i\) (or \(Y_i-X_i\), if that is the question of interest). The paired t test is a one-sample t test of the population mean difference \(\mu_D=E[D_i]\), using the \(n\) observed differences \(D_1,\ldots,D_n\).

The direction is part of the model, not a cosmetic choice. If \(D_i\) is defined as before minus after, a positive mean difference indicates a decrease from before to after. Reversing the order reverses the signs of the differences and the test statistic, but not the underlying evidence when the alternative is two-sided. For a one-sided alternative, the direction must agree with the stated scientific question.

Model, Assumptions, and Test Statistic

Treat the \(n\) pairs as independent observations from a population of pairs. Dependence between the two measurements within a pair is allowed and is the reason for forming differences. For an exact small-sample paired t test, assume the pair differences are normally distributed with unknown mean \(\mu_D\) and unknown variance \(\sigma_D^2\). Thus \(D_i\sim N(\mu_D,\sigma_D^2)\), independently across pairs. For a sufficiently large sample, the procedure can often be approximate when the differences are not dominated by strong skewness or extreme outliers; the normality assumption matters most for small samples.

The hypotheses concern \(\mu_D\). A two-sided test can assess whether the mean difference differs from a specified value \(\Delta_0\); one-sided alternatives assess whether it is greater than or less than that value. The common no-average-change null sets \(\Delta_0=0\). Calculate the sample mean and sample standard deviation of the differences, then use:

$$ \bar D=\frac{1}{n}\sum_{i=1}^n D_i,\qquad s_D=\sqrt{\frac{\sum_{i=1}^n(D_i-\bar D)^2}{n-1}},\qquad t=\frac{\bar D-\Delta_0}{s_D/\sqrt n}. $$

Under the null hypothesis and the exact normal-difference model, this statistic has a Student t distribution with \(n-1\) degrees of freedom. The standard error is \(s_D/\sqrt n\), not a standard error formed by pretending that the two measurements within each pair came from independent subjects. For a two-sided level-\(\alpha\) test, reject when \(|t|>t_{1-\alpha/2,n-1}\). For a greater-than alternative, reject when \(t>t_{1-\alpha,n-1}\); reverse the inequality for a less-than alternative.

Why the t statistic applies: Under the normal-difference model, \(\bar D\) is normally distributed with mean \(\mu_D\) and variance \(\sigma_D^2/n\). Also, \((n-1)s_D^2/\sigma_D^2\) has a chi-square distribution with \(n-1\) degrees of freedom and is independent of \(\bar D\). Under \(H_0:\mu_D=\Delta_0\), dividing the standardized normal numerator by the square root of this independent chi-square quantity divided by its degrees of freedom gives a Student t variable with \(n-1\) degrees of freedom. This is the one-sample t result applied to the differences.

A two-sided \(100(1-\alpha)\%\) confidence interval for \(\mu_D\) is

$$ \bar D\ \pm\ t_{1-\alpha/2,n-1}\frac{s_D}{\sqrt n}. $$

The interval and two-sided test at the same significance level agree: the null value \(\Delta_0\) is rejected exactly when it is outside the corresponding confidence interval. Neither a small p-value nor an interval excluding zero measures the practical importance of the change; interpretation should also address the units and context.

Worked Examples

Worked Example: Testing a Before-and-After Change

In a hypothetical pilot study, six participants complete a task before and after a brief training session. Define \(D=\text{before time}-\text{after time}\), in minutes, so a positive difference means a faster time afterward. The paired times are (12, 12), (15, 14), (11, 9), (18, 16), (14, 11), and (20, 16). Test at the 5% level whether the mean difference is nonzero, and calculate a 95% confidence interval. Assume independent pairs and normally distributed differences \(D_i\sim N(\mu_D,\sigma_D^2)\), with both parameters unknown. Interest and mortality assumptions do not apply.

Method and differences. This is a paired t test: subtract within each pair in the stated order. The six differences are \(0,1,2,2,3,4\). Their sum is \(12\), so \(\bar D=12/6=2\) minutes.

Sample variance and standard error. The squared deviations from 2 are \(4,1,0,0,1,4\), with sum \(10\). Therefore \(s_D^2=10/(6-1)=2\), \(s_D=\sqrt2\), and \(SE=s_D/\sqrt6=\sqrt{1/3}=0.57735\) minutes.

Test. The hypotheses are \(H_0:\mu_D=0\) and \(H_1:\mu_D\ne0\). The statistic is \(t=(2-0)/0.57735=3.4641\), with \(6-1=5\) degrees of freedom. The two-sided 5% critical value is \(t_{0.975,5}\approx2.5706\). Since \(|3.4641|>2.5706\), reject \(H_0\). The data provide evidence of a nonzero mean change; since the observed mean difference is positive, the sample indicates shorter task times after training.

Confidence interval. The margin is \(2.5706(0.57735)\approx1.48413\). Thus the 95% interval is \(2\pm1.48413=(0.51587,3.48413)\) minutes, or \((0.516,3.484)\) minutes to three decimal places. It excludes zero, in agreement with the test.

Check and common mistake. The differences sum to 12 and have mean 2; the interval is centered at that mean. The calculation uses six pairs, not twelve independent observations. Treating the before and after measurements as independent would discard the pairing and use the wrong standard error.

Worked Example: Matched Subjects and a Nonzero Null Value

In a hypothetical assessment, five matched pairs of trainees each complete two formats. Define \(D=\text{Format A score}-\text{Format B score}\). The observed differences are \(2,4,1,3,0\) points. Test at the 5% level whether the population mean difference differs from 1 point. Assume independent matched pairs and normally distributed differences \(D_i\sim N(\mu_D,\sigma_D^2)\), with unknown parameters. Interest and mortality assumptions do not apply.

Method and summary. The differences sum to \(10\), so \(\bar D=10/5=2\). Relative to 2, the deviations are \(0,2,-1,1,-2\), whose squared values sum to \(10\). Thus \(s_D^2=10/(5-1)=2.5\), and \(SE=\sqrt{2.5/5}=\sqrt{0.5}=0.7071\).

Test. Use \(H_0:\mu_D=1\) against \(H_1:\mu_D\ne1\). The statistic is \(t=(2-1)/0.7071=1.4142\), with \(4\) degrees of freedom. The two-sided 5% critical value is \(t_{0.975,4}\approx2.776\). Because \(|1.4142|<2.776\), do not reject \(H_0\). The sample does not provide sufficient evidence at this level that the mean difference differs from 1 point.

Interval check. The 95% interval is \(2\pm2.776(0.7071)\), with margin approximately \(1.963\), giving \((0.037,3.963)\) points to three decimal places. The null value 1 is inside the interval, consistent with the test decision.

Check and common mistake. The null value is 1, not 0, so the numerator is \(\bar D-1\). Using \(\bar D/SE\) would test the wrong null hypothesis. The answer is not proof that the mean difference equals 1; it is a failure to find sufficient evidence against that value.

Worked Example: A One-Sided Test on Matched Measurements

In a hypothetical study, eight participants use two display layouts and rate the ease of completing a task. Let \(D=\text{Layout A rating}-\text{Layout B rating}\). The observed differences are \(1,2,2,3,0,1,3,4\) rating points. At the 5% level, test whether the mean difference is greater than 1 point. Assume independent pairs and normally distributed differences \(D_i\sim N(\mu_D,\sigma_D^2)\), with unknown parameters. Interest and mortality assumptions do not apply.

Method and summary. The differences sum to \(16\), so \(\bar D=16/8=2\). The squared deviations from 2 are \(1,0,0,1,4,1,1,4\), summing to \(12\). Hence \(s_D^2=12/7\), and \(SE=\sqrt{(12/7)/8}=\sqrt{3/14}\approx0.46291\).

Test. The hypotheses are \(H_0:\mu_D\le1\) and \(H_1:\mu_D>1\); the test statistic is calculated at the boundary value 1. Thus \(t=(2-1)/0.46291\approx2.1602\), with \(7\) degrees of freedom. The one-sided 5% critical value is \(t_{0.95,7}\approx1.895\). Since \(2.1602>1.895\), reject the null in favor of a mean difference greater than 1 point.

Check and common mistake. The direction of \(D\) makes a positive difference favor Layout A, and the alternative is greater than 1, so the upper-tail rejection rule is appropriate. A two-sided critical value would not match the stated one-sided question. The conclusion concerns the population mean difference, not the experience of every participant.

What Pairing Does—and Does Not—Assume

The analysis is performed on one difference per pair. It does not require the two measurements within a pair to be independent, nor does it require their marginal variances to be equal. The relevant small-sample distributional condition is normality of the differences. Pair differences should also be independent across pairs; repeated observations from the same person cannot automatically be treated as independent pairs.

A before-and-after design may have other limitations. For instance, changes over time, practice, or external events could explain some observed change. Matching can improve precision by controlling stable differences between subjects, but the t test alone cannot eliminate confounding or establish causation.

1
Choose the direction.
State exactly which measurement is subtracted from which, and interpret the sign.
2
Form one difference per pair.
Keep the two observations together; do not rearrange measurements into independent groups.
3
Check the model and hypotheses.
Assess independence across pairs and the suitability of the difference distribution, then specify the null value and tail.
4
Calculate and interpret.
Use \(n-1\) degrees of freedom, compare with the appropriate t critical value (or use a p-value), and state the conclusion in context.

Common Exam Traps

  • Ignoring the pairing. A paired design has \(n\) differences, not two independent samples of size \(n\). An independent-samples standard error does not generally equal the paired standard error.
  • Reversing the sign. If a positive difference is intended to mean improvement, verify that the subtraction order makes that true. A sign reversal also reverses the direction of a one-sided alternative.
  • Testing the wrong value. For \(H_0:\mu_D=\Delta_0\), use \(\bar D-\Delta_0\) in the numerator, not automatically \(\bar D\).
  • Using the wrong degrees of freedom. The paired t test has \(n-1\) degrees of freedom, where \(n\) is the number of complete pairs.
  • Overstating the conclusion. A statistically significant mean difference does not imply that every pair changed in the same direction or that a treatment caused the change.
Key takeaway: A paired t test is a one-sample t test on consistently defined within-pair differences. Its precision and validity depend on treating the pairs as the observational units and checking assumptions for the differences.

Check Your Understanding

For each question, define the difference in the stated order and use the paired t procedure. Assume independent pairs and normally distributed differences where an exact small-sample test is requested.

  1. A hypothetical before-and-after study has four differences, defined as before minus after, of \(1,2,3,2\) units. Test \(H_0:\mu_D=0\) against a two-sided alternative at 5%. Give \(\bar D\), \(s_D^2\), \(t\), and the decision. (Answer: \(\bar D=2,\ s_D^2=2/3,\ t=4.899\) with 3 degrees of freedom; reject at 5%.)
  2. Five matched pairs have differences \(4,2,3,1,5\). Test \(H_0:\mu_D=2\) against a two-sided alternative at 5%. (Answer: \(\bar D=3,\ s_D^2=2.5,\ t=1.414\) with 4 degrees of freedom; do not reject.)
  3. Six participants have paired differences \(3,1,2,4,2,0\), defined so positive values indicate improvement. Find the 95% confidence interval for \(\mu_D\), using \(t_{0.975,5}\approx2.5706\). (Answer: \(\bar D=2,\ s_D^2=2,\ SE=\sqrt{1/3}\approx0.5774\); the interval is approximately \((0.516,3.484)\) to three decimal places.)
  4. Seven matched pairs have differences \(1,2,1,3,2,0,2\). Test \(H_0:\mu_D\le1\) against \(H_1:\mu_D>1\) at 5%, using \(t_{0.95,6}\approx1.943\). (Answer: \(\bar D=11/7,\ s_D^2=20/21,\ SE=\sqrt{20/147}\approx0.3689,\ t\approx1.549\); do not reject.)
  5. Eight matched pairs have differences \(1,2,2,3,0,1,3,4\). Test \(H_0:\mu_D\le1\) against \(H_1:\mu_D>1\) at 5%, using \(t_{0.95,7}\approx1.895\). (Answer: \(\bar D=2,\ s_D^2=12/7,\ SE=\sqrt{3/14}\approx0.4629,\ t\approx2.160\); reject in favor of a mean difference greater than 1.)
Clinical Biostats