Suppose that are realisations of IID random variables with distribution and are realisations of IID random variables with distribution. Assume that the samples are paired and that the population variances are unknown.
By assuming paired samples, the random variables within a pair, and are longer independent. To make things easier, we will therefore assume the same covariance for all pairs, i.e. for .
In the case of paired data, to test the null hypothesis
against any of the alternatives , and , we consider the differences . The above hypothesis can then be rewritten in terms of the population mean of the differences,
which is tested against , and respectively.
The algorithm for this test is as follows:
Calculate the differences for .
Calculate the sample mean and sample variance of the differences .
Calculate the test statistic,
Compare this to the -distribution, either by finding a -value, or by using an appropriate critical value.
This example comes from Chapter 6 of Diggle and Chetwynd (2011). They report results on a clinical trial to compare two anti-congestion drugs used to relieve short-term symptoms of asthma: each individual tests both drugs.
In the asthma drug trial, the maximum rate at which the individual was able to exhale, denoted by PEF (Peak Expiratory Flow), was measured a fixed time after administration of each treatment. The following table shows the results for all 13 participants,
Individual () | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Drug F () | 310 | 310 | 370 | 410 | 250 | 380 | 330 | 385 | 400 | 410 | 320 | 340 | 220 |
Drug S () | 270 | 260 | 300 | 390 | 210 | 350 | 365 | 370 | 310 | 380 | 290 | 260 | 90 |
Differences, | 40 | 50 | 70 | 20 | 40 | 30 | -35 | 15 | 90 | 30 | 30 | 80 | 130 |
() |
For the two drugs F and S, test the following
vs.
This is equivalent to testing
vs.
where .
Calculate the differences by subtracting PEF for drug S from PEF for drug F; these are given in the above table.
Calculate the sample mean and variance of the differences
,
.
Find the test statistic
The -value for this, since and the alternative hypothesis is two-tailed, is
that is , so we would reject at the 5% level and conclude that there is evidence of a difference in the mean PEF between the two drugs.
Note that we should always be careful to remove any other which could affect the hypothesis test. In this experiment, administration of the second was separated from administration of the first by a time interval sufficient to ensure that any effects of the first drug have worn off; the order in which the two treatments are given is randomised to remove the potential effect of ordering.