The Sign Test
Purpose
The sign test determines whether System A is significantly better than System B on a classification task. It tests the null hypothesis that both systems are equally good and any observed differences are due to chance.
Setup
- H0 (null hypothesis): Systems A and B are identical; differences are due to chance.
- H1 (alternative): System A is better than System B (one-tailed) or systems differ (two-tailed).
- Compare item by item: for each document, note whether A wins, B wins, or they tie.
The MLRD Tie Rule (CRITICAL)
Standard statistics textbooks say to discard ties. For classification tasks, this is wrong. Discarding ties reduces , inflating the test statistic and causing a Type 1 error (falsely claiming significance).
The MLRD rule: distribute ties evenly. Let = number of ties. Add to (A’s wins) and to (B’s wins). Round up at the end. remains unchanged.
Test Statistic
Under H0, each item is equally likely to favour A or B (ignoring ties). Test statistic:
- One-tailed p-value:
- Two-tailed p-value:
If : reject H0; A is significantly better. If : inconclusive; cannot claim A is better.
Full Worked Example
200 documents are classified by both System A and System B:
- A wins on 110 documents
- B wins on 70 documents
- Ties on 20 documents
Step 1 — Apply the tie rule: (unchanged)
Step 2 — Two-tailed test: We test whether A differs from B (in either direction). Under H0, .
For a binomial with , , the mean is and variance is . We can approximate using the normal distribution:
From standard normal tables: .
Two-tailed .
Step 3 — Conclusion: . Reject H0. System A is significantly better than System B.
If we had discarded ties (wrong): , , , giving a smaller p-value. This inflates the apparent significance, risking a false claim.
Why Not Discard Ties?
Discarding ties reduces from 200 to 180. The test statistic increases because the denominator shrinks while the numerator stays similar. This makes the test more likely to reject H0 even when A and B are truly identical (Type 1 error). The MLRD rule keeps fixed and distributes ties as half-wins, which is more conservative and honest.
Summary
| Step | Action |
|---|---|
| 1 | Count A wins, B wins, ties |
| 2 | , round up |
| 3 | unchanged |
| 4 | Compute |
| 5 | If two-tailed, multiply by 2 |
| 6 | Compare to |
Past paper questions: y2023p3q8 (evaluation methods)