Lably
Skip to content

Paired difference test

Type of location test in statistical analysis

  • 9 min read
  • 2 chapters

Related on Lably

Through Expected value, Student's t-test and Average

Specific methods for carrying out paired difference tests include the paired-samples t-test, the paired Z-test, the Wilcoxon signed-rank test and others.

Use in reducing variance

Paired difference tests for reducing variance are a specific type of blocking. To illustrate the idea, suppose we are assessing the performance of a drug for treating high cholesterol. Under the design of our study, we enroll 100 subjects, and measure each subject's cholesterol level. Then all the subjects are treated with the drug for six months, after which their cholesterol levels are measured again. Our interest is in whether the drug has any effect on mean cholesterol levels, which can be inferred through a comparison of the post-treatment to pre-treatment measurements.

The key issue that motivates the paired difference test is that unless the study has very strict entry criteria, it is likely that the subjects will differ substantially from each other before the treatment begins. Important baseline differences among the subjects may be due to their gender, age, smoking status, activity level, and diet.

There are two natural approaches to analyzing these data:

  • In an "unpaired analysis", the data are treated as if the study design had actually been to enroll 200 subjects, followed by random assignment of 100 subjects to each of the treatment and control groups. The treatment group in the unpaired design would be viewed as analogous to the post-treatment measurements in the paired design, and the control group would be viewed as analogous to the pre-treatment measurements. We could then calculate the sample means within the treated and untreated groups of subjects, and compare these means to each other.
  • In a "paired difference analysis", we would first subtract the pre-treatment value from the post-treatment value for each subject, then compare these differences to zero.

If we only consider the means, the paired and unpaired approaches give the same result. To see this, let Yi1, Yi2 be the observed data for the ith pair, and let Di = Yi2 − Yi1. Also let D, Y1, and Y2 denote, respectively, the sample means of the Di, the Yi1, and the Yi2. By rearranging terms we can see that

D¯=1n∑i(Yi2−Yi1)=1n∑iYi2−1n∑iYi1=Y¯2−Y¯1,

where n is the number of pairs. Thus the mean difference between the groups does not depend on whether we organize the data as pairs.

Although the mean difference is the same for the paired and unpaired statistics, their statistical significance levels can be very different, because it is easy to overstate the variance of the unpaired statistic. Through Bienaymé's identity, the variance of D is

var(D¯)=var⁡(Y¯2−Y¯1)=var⁡(Y¯2)+var⁡(Y¯1)−2cov⁡(Y¯1,Y¯2)=σ12/n+σ22/n−2σ1σ2corr⁡(Yi1,Yi2)/n,

where σ1 and σ2 are the population standard deviations of the Yi1 and Yi2 data, respectively. Thus the variance of D is lower if there is positive correlation within each pair. Such correlation is very common in the repeated measures setting, since many factors influencing the value being compared are unaffected by the treatment. For example, if cholesterol levels are associated with age, the effect of age will lead to positive correlations between the cholesterol levels measured within subjects, as long as the duration of the study is small relative to the variation in ages in the sample.

Power of the paired Z-test

Suppose we are using a Z-test to analyze the data, where the variances of the pre-treatment and post-treatment data σ12 and σ22 are known (the situation with a t-test is similar). The unpaired Z-test statistic is

Y¯2−Y¯1σ12/n+σ22/n,

The power of the unpaired, one-sided test carried out at level α = 0.05 can be calculated as follows:

P(Y¯2−Y¯1σ12/n+σ22/n>1.645)=P(Y¯2−Y¯1S>1.645σ12/n+σ22/n/S)=P(Y¯2−Y¯1−δ+δS>1.645σ12/n+σ22/n/S)=P(Y¯2−Y¯1−δS>1.645σ12/n+σ22/n/S−δ/S)=1−Φ(1.645σ12/n+σ22/n/S−δ/S),

where S is the standard deviation of D, Φ is the standard normal cumulative distribution function, and δ = EY2 − EY1 is the true effect of the treatment. The constant 1.645 is the 95th percentile of the standard normal distribution, which defines the rejection region of the test.

By a similar calculation, the power of the paired Z-test is

1−Φ(1.645−δ/S).

By comparing the expressions for power of the paired and unpaired tests, one can see that the paired test has more power as long as

σ12/n+σ22/n/S=σ12+σ22σ12+σ22−2σ1σ2ρ>1 where ρ:=corr⁡(Yi1,Yi2).

This condition is met whenever ρ, the within-pairs correlation, is positive.

A random effects model for paired testing

The following statistical model is useful for understanding the paired difference test

Yij=μj+αi+εij

where αi is a random effect that is shared between the two values in the pair, and εij is a random noise term that is independent across all data points. The constant values μ1, μ2 are the expected values of the two measurements being compared, and our interest is in δ = μ2 − μ1.

In this model, the αi capture "stable confounders" that have the same effect on the pre-treatment and post-treatment measurements. When we subtract to form Di, the αi cancel out, so do not contribute to the variance. The within-pairs covariance is

cov⁡(Yi1,Yi2)=var⁡(αi).

This is non-negative, so it leads to better performance for the paired difference test compared to the unpaired test, unless the αi are constant over i, in which case the paired and unpaired tests are equivalent.

In less mathematical terms, the unpaired test assumes that the data in the two groups being compared are independent. This assumption determines the form for the variance of D. However, when two measurements are made for each subject, it is unlikely that the two measurements are independent. If the two measurements within a subject are positively correlated, the unpaired test overstates the variance of D, making it a conservative test in the sense that its actual type I error probability will be lower than the nominal level, with a corresponding loss of statistical power. In rare cases, the data may be negatively correlated within subjects, in which case the unpaired test becomes anti-conservative. The paired test is generally used when repeated measurements are made on the same subjects, since it has the correct level regardless of the correlation of the measurements within pairs.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Statistics