Maths4U
Menu

Maths4U Original · Learn, check, explain

Non-parametric tests — 9231 FPS

Discard zero differences and use the binomial sign-count model. Use signed ranks and recognise the symmetry and continuity assumptions. Pool two independent samples and calculate an exact rank-sum probability.

Notes and key methods

A sign test for a continuous population median counts observations above and below the null median. Under H₀, each nonzero difference is equally likely to be positive or negative, so the positive count is Bin(n,1/2).

For paired data, first calculate differences in the stated order. Remove zero differences before fixing n. The sign test uses direction alone and does not require the symmetry assumption needed by the signed-rank test.

Remove zero differences, rank their absolute values, and sum ranks separately for positive and negative differences. Ties in absolute magnitude receive average ranks. State whether the test statistic is W⁺, W⁻ or the smaller of the two.

The exact no-tie distribution treats all 2ⁿ sign allocations as equally likely under a continuous symmetric null distribution of differences. For a directional alternative, select the matching tail before interpreting the result.

Combine the two samples and rank all observations together. Let R be the rank sum of the first sample. Equivalently, \(U=R-n_1(n_1+1)/2\).

Under identical continuous distributions, each selection of n₁ pooled ranks is equally likely. A location-shift interpretation additionally requires comparable distribution shapes. This test is for independent samples, unlike a matched-pairs signed-rank test.

Check the conditions

Three worked examples

Example 1 · Exact sign tests

After removing zero differences, 9 independent paired differences contain 7 positive and 2 negative values. The alternative is a positive population median difference.

Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.

  1. Find the expected positive count under H₀.
  2. Find the exact one-sided p-value.
  3. Find the exact two-sided p-value using twice the smaller tail, capped at one.
  4. If three exact zero differences had also been recorded, find the original number of pairs.
Show the reasoning

(a)

\(n/2=\frac{9}{2}\)

Answer: \(\frac{9}{2}\).

(b)

\(P(\operatorname{Bin}(9,1/2)\ge 7)=0.08984375\)

Answer: \(0.08984375\).

(c)

\(\min(1,2p_{\rm one-sided})=0.1796875\)

Answer: \(0.1796875\).

(d)

\(9+3=12\)

Answer: \(12\).

The p-value is \(0.08984375\). Since it exceeds 0.05, do not reject H₀: the sample gives insufficient evidence that the population median difference is positive. This does not give the probability that H₀ is true.

Example 2 · Wilcoxon signed-rank tests

Independent paired differences are \(-1,2,3,-4,5,6,7,8\). Their absolute values are distinct. Assume a continuous symmetric population of differences and test for a positive shift.

Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.

  1. Find W+, the sum of positive ranks.
  2. Find W−, the sum of negative ranks.
  3. Find the exact upper-tail p-value for W+.
  4. Find the sum of all ranks.
Show the reasoning

(a)

\(W^+=31\)

Answer: \(31\).

(b)

\(W^-=5\)

Answer: \(5\).

(c)

\(P(W^+\ge 31)=\frac{5}{128}\) by all 256 equally likely sign allocations.

Answer: \(\frac{5}{128}\).

(d)

\(n(n+1)/2=36\)

Answer: \(36\).

The p-value is \(0.0390625\). Since it is at most 0.05, reject H₀: there is evidence that the population has a positive location shift. This does not give the probability that H₀ is true.

Example 3 · Wilcoxon rank-sum tests

Two independent samples have pooled ranks A: \(1,2,3\) and B: \(4,5,6,7,8,9,10\). There are no ties. Test whether A tends to be smaller.

Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.

  1. Find the rank sum R for sample A.
  2. Find the corresponding U statistic for A.
  3. Find the exact lower-tail p-value.
  4. Find the null expected rank sum for A.
Show the reasoning

(a)

\(R=6\)

Answer: \(6\).

(b)

\(U=R-n_1(n_1+1)/2=0\)

Answer: \(0\).

(c)

\(P(R\le 6)=\frac{1}{120}\) by equally likely choices of 3 pooled ranks.

Answer: \(\frac{1}{120}\).

(d)

\(E(R)=n_1(n+1)/2=\frac{33}{2}\)

Answer: \(\frac{33}{2}\).

The p-value is \(0.00833333333333333\). Since it is at most 0.05, reject H₀: there is evidence that the first population tends to give smaller values. This does not give the probability that H₀ is true.

Common mistakes

Practise with answer checking

Original exam-style problems

Write complete solutions before opening the worked solution. The marking guidance rewards reasoning as well as answers.

Examination practice · 2020–2026

Apply the method to recent source-labelled questions from this chapter.

Browse recent examination questions · All topic resources and the full bank

Next skill: Single-sample sign test →