Tutorials › Introduction to Statistics › Hypothesis Tests for a Mean Paired Difference

Paired and Matched Designs · Tutorial 761 of 996

Hypothesis Tests for a Mean Paired Difference

Use the paired differences as one sample to test a specified population mean difference and report the evidence in context.

Intermediate 9 min read

What You'll Learn

  • Define the population mean paired difference and state its null value.
  • Choose a one- or two-sided alternative that matches the research question.
  • Calculate the paired t statistic and its degrees of freedom.
  • Check the conditions for a paired t test.
  • Interpret a p-value and conclusion in the original units and context.
  • Recognize why paired observations must be analyzed through their differences.

Why Test a Mean Paired Difference?

When each observational unit contributes two linked measurements, the question is often whether the average difference is zero—or whether it equals some other specified value. For example, a researcher might compare each participant’s measurement before and after a program. The relevant information is the within-person change, not two unrelated collections of measurements.

A paired t test turns those changes into a single sample and tests a claim about their population mean. The direction used to calculate differences must be stated: reversing it reverses the signs of the differences and changes the direction of a one-sided alternative.

Definition: Let \(d_i\) be the difference for pair \(i\), calculated using a stated and consistent order, and let \(\mu_d\) be the population mean of these paired differences. A paired t test tests a null hypothesis \(H_0:\mu_d=\delta_0\), where \(\delta_0\) is the specified null mean difference. The sample mean difference is \(\bar{d}\), the sample standard deviation of the differences is \(s_d\), and the number of complete pairs is \(n\).

The analysis is performed on the \(n\) differences. It is not a test that treats the first measurements and second measurements as independent samples. For instance, if \(d_i\) is defined as “before minus after,” then a positive \(d_i\) means the measurement decreased from before to after.

Hypotheses and the Test Statistic

The null hypothesis specifies the mean difference to be tested. The alternative expresses the question of interest. A two-sided alternative asks whether the population mean differs from the specified value in either direction; a one-sided alternative asks whether it is greater or less. Choose the direction before examining the results, and make sure it agrees with the definition of \(d_i\).

Research questionAlternative hypothesis
Is the mean difference different from \(\delta_0\)?\(H_a:\mu_d\ne\delta_0\)
Is the mean difference greater than \(\delta_0\)?\(H_a:\mu_d>\delta_0\)
Is the mean difference less than \(\delta_0\)?\(H_a:\mu_d<\delta_0\)

Under the null hypothesis, the difference between the observed sample mean and the null value is measured in standard errors. The test statistic is:

$$ t=\frac{\bar{d}-\delta_0}{s_d/\sqrt{n}}, \qquad df=n-1 $$

The denominator, \(s_d/\sqrt{n}\), is the estimated standard error of the sample mean difference. The degrees of freedom are \(n-1\), because the sample standard deviation is calculated from the \(n\) differences after estimating their mean.

Model and assumptions: The paired t test uses the distribution of the differences, not the separate measurement distributions. The pairs should be independent of one another, and the differences should be quantitative. For an exact t test, the differences are drawn from a normally distributed population. With a sufficiently large sample, the procedure can often be useful when the difference distribution is not normal, provided it has no severe skewness or extreme outliers. The sampling or assignment design must also support the population or process to which the conclusion is meant to apply.

For a small sample, it is especially important to inspect the differences for strong skewness or extreme outliers; a large number of pairs does not make dependent pairs independent. The normality condition concerns the distribution of the differences, not whether either set of original measurements is itself normal.

Why the Statistic Has a t Distribution

A short justification explains both the form of the statistic and its degrees of freedom. Suppose the \(n\) differences are independent observations from a normal population with mean \(\mu_d\) and standard deviation \(\sigma_d\). Under \(H_0:\mu_d=\delta_0\), the sample mean, standardized using the true standard deviation, has a standard normal distribution:

$$ Z=\frac{\bar{d}-\delta_0}{\sigma_d/\sqrt{n}}\sim N(0,1) $$

The population standard deviation is unknown, so the test uses \(s_d\) in its place. For independent normal observations, \((n-1)s_d^2/\sigma_d^2\) has a chi-square distribution with \(n-1\) degrees of freedom and is independent of \(Z\). Dividing a standard normal variable by the square root of an independent chi-square variable divided by its degrees of freedom gives a t distribution. Therefore:

$$ \frac{Z}{\sqrt{\left((n-1)s_d^2/\sigma_d^2\right)/(n-1)}} = \frac{\bar{d}-\delta_0}{s_d/\sqrt{n}} \sim t_{n-1} $$

This result makes the p-value possible: if the null hypothesis and model assumptions hold, the test statistic follows a t distribution with \(n-1\) degrees of freedom.

Carrying Out the Test

1
Define the difference.
State the subtraction order and what positive and negative values mean.
2
State the hypotheses.
Specify \(H_0:\mu_d=\delta_0\) and choose the alternative that matches the research question.
3
Check the conditions.
Consider independence between pairs, the nature of the differences, and whether the difference distribution supports t inference.
4
Calculate the statistic and p-value.
Use \(t=(\bar{d}-\delta_0)/(s_d/\sqrt{n})\) with \(df=n-1\). The alternative determines which tail or tails contribute to the p-value.
5
Make a contextual decision.
Compare the p-value with the chosen significance level \(\alpha\), then state what the evidence indicates about the population mean difference.

A p-value is the probability, assuming the null hypothesis and test model are correct, of obtaining a test statistic at least as extreme as the observed one in the direction specified by \(H_a\). For a two-sided alternative, “at least as extreme” includes values equally far into either tail. A small p-value is evidence against the null, but it is not the probability that the null hypothesis is true.

Worked Example: Testing for Any Mean Change

Hypothetical data. Eight participants have their measurement recorded before and after a program. Define \(d_i=\text{before}-\text{after}\), so a positive difference represents a decrease. The observed differences, in units, are \(2,4,3,1,5,2,4,3\). Test whether the population mean difference differs from zero, using \(\alpha=0.05\).

The hypotheses are \(H_0:\mu_d=0\) and \(H_a:\mu_d\ne0\). Assume these eight pairs are independent and that the population of differences is reasonably modeled as normal. With only eight pairs, that distributional assumption matters; it should be supported by subject-matter knowledge and inspection of the differences.

The sample mean is \(\bar{d}=24/8=3\) units. The deviations from 3 are \(-1,1,0,-2,2,-1,1,0\), whose squared values sum to 12. Thus:

$$ s_d=\sqrt{\frac{12}{8-1}}=1.309\text{ units}, \qquad SE=\frac{1.309}{\sqrt{8}}=0.4630\text{ units} $$

Using \(\delta_0=0\), the statistic is:

$$ t=\frac{3-0}{0.4630}=6.48,\qquad df=8-1=7 $$

For a two-sided test with 7 degrees of freedom, the p-value is approximately \(0.00033\). Since \(0.00033<0.05\), reject \(H_0\). Under the stated model and assumptions, the data provide evidence that the population mean before-minus-after difference is not zero. Because the estimated difference is positive, the observed sample indicates an average decrease; the test itself asks whether the mean differs from zero in either direction.

Worked Example: Testing a Directional Claim

Hypothetical data. In six independent matched pairs, a quantitative outcome is measured under two conditions. Define \(d_i=\text{condition A}-\text{condition B}\). The differences are \(1,2,0,3,1,2\) points. Test whether the mean difference is greater than zero, using \(\alpha=0.05\).

The hypotheses are \(H_0:\mu_d=0\) and \(H_a:\mu_d>0\). Suppose the pairs are independent and the differences come from a normal population. The sample is small, so the normality assumption should be considered carefully rather than inferred from the sample size.

The differences sum to 9, so \(\bar{d}=9/6=1.5\) points. The squared deviations from 1.5 sum to \(5.5\), giving:

$$ s_d=\sqrt{\frac{5.5}{6-1}}=\sqrt{1.1}=1.049\text{ points}, \qquad SE=\frac{1.049}{\sqrt{6}}=0.4282\text{ points} $$

The test statistic and degrees of freedom are:

$$ t=\frac{1.5-0}{0.4282}=3.50,\qquad df=6-1=5 $$

Because the alternative is greater than zero, use the upper-tail probability. For \(t=3.50\) with 5 degrees of freedom, the one-sided p-value is approximately \(0.0086\). Since \(0.0086<0.05\), reject \(H_0\). The data provide evidence, under the model assumptions, that the population mean condition-A-minus-condition-B difference is greater than zero. This directional conclusion follows from the prespecified alternative and the stated subtraction order.

Worked Example: Testing a Nonzero Null Difference

Hypothetical data. Seven independent pairs have differences, in minutes, defined as \(d_i=\text{first measurement}-\text{second measurement}\). The values are \(3,1,4,2,0,5,1\). Test whether the population mean difference is 2 minutes, using a two-sided alternative and \(\alpha=0.05\).

The hypotheses are \(H_0:\mu_d=2\) minutes and \(H_a:\mu_d\ne2\) minutes. Assume the pairs are independent and the differences are plausibly normally distributed; with seven pairs, strong skewness or an extreme outlier would call the t model into question.

The differences sum to 16, so \(\bar{d}=16/7=2.286\) minutes. Their squared values sum to 56. The sum of squared deviations is \(56-16^2/7=136/7\), so:

$$ s_d=\sqrt{\frac{136/7}{7-1}}=1.800\text{ minutes}, \qquad SE=\frac{1.800}{\sqrt{7}}=0.6802\text{ minutes} $$

The test compares the sample mean with 2, not with zero:

$$ t=\frac{2.286-2}{0.6802}=0.420,\qquad df=7-1=6 $$

The two-sided p-value is approximately \(0.689\). Since \(0.689>0.05\), do not reject \(H_0\). The data do not provide sufficient evidence that the population mean difference is different from 2 minutes. This conclusion does not establish that the population mean is exactly 2 minutes.

Common Mistakes and Why the Test Matters

The paired t test is useful because it targets the mean of within-pair differences directly. The pairing matters: measurements from the same person or deliberately matched units are linked, and their difference captures the within-pair comparison. Treating the two columns as independent samples discards that structure and generally answers a different question.

  • Changing the subtraction order without changing the interpretation. If \(d_i\) changes from before-minus-after to after-minus-before, the signs of all differences reverse. State the order and interpret the sign consistently.
  • Using zero as the null value automatically. Zero is common when testing for no average difference, but the specified null value can be any \(\delta_0\). The statistic must compare \(\bar{d}\) with that value.
  • Choosing a one-sided test after seeing the data. The direction of \(H_a\) should reflect the research question before looking at the observed direction. Selecting the favorable tail afterward changes the test.
  • Checking normality of each original measurement instead of the differences. The t procedure models the distribution of paired differences. It is that distribution whose shape matters, especially for small \(n\).
  • Writing “accept the null.” A large p-value does not prove the null value is correct. State that the test did not provide sufficient evidence against \(H_0\).
Key takeaway: A paired t test is a one-sample t test on the consistently coded within-pair differences. State the target mean and null value, select the alternative in advance, check the difference-based assumptions, and report the p-value and conclusion in context.

Check Your Understanding

Use the stated difference order when answering.

  1. If \(d_i=\text{after}-\text{before}\), what does a negative difference mean?
  2. A study tests whether the mean paired difference exceeds 4 units. Write \(H_0\) and \(H_a\).
  3. For \(n=12\) complete pairs, what degrees of freedom does the paired t test use?
  4. Why is the distribution of differences, rather than the distributions of the two original measurements, relevant to the paired t test?
  5. A two-sided test gives \(p=0.12\) at \(\alpha=0.05\). Write a correct conclusion that does not claim the null hypothesis has been proved.