4.4 - Non-parametric tests for paired data

4.4 - Non-parametric tests for paired data

When two measurements belong to the same person or matched unit, their pairing contains useful information. Learn how to test for a systematic population difference using signs or signed ranks, and how the assumptions determine which method is suitable.

The paired sign test

If six of eight people improve after training, is that convincing evidence of a population improvement? First keep each person's two measurements together.

For paired data, calculate one difference per pair. Measurements within a pair may be dependent; the differences from distinct randomly selected pairs must be independent. Eight people measured twice give eight differences, not sixteen independent observations.

Paired sign comparison

Choose a direction, such as D=after−beforeD=\text{after}-\text{before}. The paired sign test uses only whether each nonzero difference is positive or negative.

The no-systematic-difference null is a population median difference of zero, giving P(D>0)=1/2\mathrm P(D>0)=1/2 for continuous differences. A directional alternative changes this probability above or below 1/21/2.

For a comparison of populations, state the null in context: the two conditions have the same population performance, with no systematic paired difference. The sign test investigates directional differences through the signs; it cannot establish that every aspect of two population distributions is identical. Use the distribution of paired differences, rather than subtracting two unrelated sample medians.

Under the sign-test null, S∼B(n,1/2)S\sim\mathrm B(n,1/2), where SS counts positive differences and nn counts pairs. No symmetry assumption is needed. The examples have no zero differences; a zero has no sign and must not be counted as positive.

Worked example 1: improvement as a positive difference

Question. Eight randomly selected people take a scored task before and after training. Higher scores are better. Use a sign test at 5%5\% to investigate whether after-training performance tends to be better.

PersonABCDEFGH
Before10101414111115151212131316161818
After11.111.113.613.613.313.315.715.710.210.214.514.519.219.218.218.2

Assume the sampled pairs are independent and the population differences are continuous.

Plan. Define after minus before, then use the upper binomial tail for improvements.

The differences are 1.1,−0.4,2.3,0.7,−1.8,1.5,3.2,0.21.1,-0.4,2.3,0.7,-1.8,1.5,3.2,0.2, so S=6S=6. State H0H_0: no systematic population difference, with median D=0D=0; H1H_1: after-training scores tend to be higher, with median D>0D>0.

Under H0H_0, S∼B(8,1/2)S\sim\mathrm B(8,1/2), giving

P(S≥6)=(86)+(87)+(88)28=37256=0.14453125.\mathrm P(S\ge6)=\frac{\binom86+\binom87+\binom88}{2^8} =\frac{37}{256}=0.14453125.

Answer. Since 0.1445>0.050.1445>0.05, do not reject H0H_0. There is insufficient evidence that after-training performance tends to be better.

Check. Directly comparing the two score rows shows improvements for A, C, D, F, G and H: six distinct people, matching the sign count.

Reverse only the subtraction convention. The scientific claim stays the same, so the probability and conclusion must stay the same too.

Worked example 2: reversing the difference direction

Question. Repeat Worked example 1 using E=before−afterE=\text{before}-\text{after}.

Plan. Rewrite the alternative before selecting the probability tail.

Now improvements have negative EE. The differences are −1.1,0.4,−2.3,−0.7,1.8,−1.5,−3.2,−0.2-1.1,0.4,-2.3,-0.7,1.8,-1.5,-3.2,-0.2, so the positive count is SE=2S_E=2.

The null is median E=0E=0, and the same improvement claim becomes median E<0E<0. Under H0H_0, SE∼B(8,1/2)S_E\sim\mathrm B(8,1/2), so

P(SE≤2)=1+8+28256=0.14453125.\mathrm P(S_E\le2)=\frac{1+8+28}{256}=0.14453125.

Answer. The same probability exceeds 0.050.05: there is insufficient evidence of improved population performance.

Check. Every pair has exactly one sign, so SE=8−S=2S_E=8-S=2. The events S≥6S\ge6 and SE≤2S_E\le2 describe exactly the same sign arrangements.

For large numbers of pairs, the sign count can instead be approximated by N(n/2,n/4)\mathrm N(n/2,n/4), with the same continuity corrections as a one-sample sign test. Pairing changes how observations become differences, not the binomial calculation.

Watch out

A paired sign test counts signs. Ranking differences changes the test to a Wilcoxon matched-pairs test. Do not replace a requested sign test with it.

Follow the defined subtraction in this new task.

Wilcoxon matched pairs

When the population distribution of paired differences is symmetric, their absolute ranks can add information about the size of the changes.

Apply the one-sample signed-rank method to the differences DD, testing their population median against zero. This is the Wilcoxon matched-pairs signed-rank test. Require independent randomly sampled pairs and an underlying continuous distribution of differences symmetric about its median. Symmetry of the two separate measurement distributions does not by itself establish symmetry of their differences.

There are no zero differences or tied absolute differences here. Rank all ∣Di∣|D_i|, restore the signs, then form P,QP,Q. For a positive-shift alternative, a small QQ is evidence in the required direction.

Worked example 3: a matched-pairs rank test

Question. For eight independent random pairs, after-minus-before differences are 0.6,−0.1,0.8,1.4,−0.3,1.8,2.2,2.60.6,-0.1,0.8,1.4,-0.3,1.8,2.2,2.6. Assume a continuous difference distribution symmetric about its median. Test at 5%5\% whether after-values tend to be higher.

Plan. Rank absolute paired differences and compare the negative rank sum with the one-tailed critical value.

State H0:mD=0H_0:m_D=0, no systematic population difference, and H1:mD>0H_1:m_D>0. The signed ranks are

3,−1,4,5,−2,6,7,8.3,-1,4,5,-2,6,7,8.

Hence Q=1+2=3Q=1+2=3 and P=36−3=33P=36-3=33. For n=8n=8, the 5%5\% one-tailed critical value is 55. Since Q=3≤5Q=3\le5, reject H0H_0.

Answer. There is sufficient evidence at the 5%5\% level that after-values tend to be higher in the population comparison.

Check. A negative rank sum at most 33 comes from only five rank subsets: empty, {1},{2},{3},{1,2}\{1\},\{2\},\{3\},\{1,2\}. Its probability is 5/256=0.01953125<0.055/256=0.01953125<0.05, agreeing with the table decision.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account