Sign Test Calculator
Statistical tests
- Effective pairs: 17 positive differences against 8 negative ones give 25 informative pairs - ties are discarded before anything else happens.
- Exact binomial tail: under the null each pair is a fair coin, so the probability of 8 or fewer of the rarer sign is 0.0539 from the binomial sum.
- Doubling: the two-sided p-value is 2 x 0.0539 = 0.1078; the continuity-corrected normal approximation gives z = 1.600 for comparison.
- Sign test result: p = 0.1078 - the oldest nonparametric test there is, using direction alone and no magnitudes at all.
The sign test asks the least a statistical test can ask. For each pair of observations, record only whether the second value went up or down - discard how much, discard the units, discard the distribution - and then ask whether the split of signs is too lopsided for a fair coin. It is the oldest nonparametric test in statistics, and its assumptions can be written on one line.
Ties are discarded first, since a pair that did not move carries no directional evidence. What remains is a count: 17 positive differences against 8 negative ones leave 25 informative pairs in the first worked example, and under the null hypothesis the rarer sign follows a binomial distribution with probability one half. The exact two-sided p-value is 0.1078.
This calculator takes the plus and minus counts and returns the exact binomial p-value, the one-sided tail, and the continuity-corrected normal approximation (z = 1.600 in the example) for comparison with textbook tables.
Worked examples
Sign test on 17 against 8 differences
(17 · 8)
| Sign test p-value (two-sided) | 0.1078 |
| Effective pairs (ties excluded) | 25 |
| One-sided exact tail | 0.0539 |
| z (normal approx, corrected) | 1.600 |
Sign test on a lopsided split
(9 · 21)
| Sign test p-value (two-sided) | 0.0428 |
| Effective pairs (ties excluded) | 30 |
| One-sided exact tail | 0.0214 |
| z (normal approx, corrected) | -2.008 |
Sign test on a near-tie
(14 · 13)
| Sign test p-value (two-sided) | 1.0000 |
| Effective pairs (ties excluded) | 27 |
| One-sided exact tail | 0.5000 |
| z (normal approx, corrected) | 0.000 |
Direction only, no magnitudes
Throwing away magnitudes is a deliberate trade. The sign test cannot be hurt by outliers, skew, heavy tails or a recording instrument that measures some pairs badly - a wild value counts exactly as much as a tiny one, one vote. For data recorded purely as better or worse, or for differences whose sizes are not commensurable across pairs, it is not a compromise but the only honest test available.
The price is power. A paired t-test uses the sizes and, when its assumptions hold, detects smaller effects with fewer pairs; the Wilcoxon signed-rank test uses the ranks of the sizes and recovers much of that power while keeping most of the robustness. The sign test is what remains when even ranks cannot be trusted - and in that situation its exactness is worth more than the power it surrenders.
| Test | Uses | Assumptions |
|---|---|---|
| Sign test | Direction of each difference only | Independent pairs; nothing about distributions |
| Wilcoxon signed-rank | Direction and rank of size | Symmetric differences for the classic form |
| Paired t-test | Full magnitudes | Differences approximately normal (or large n) |
Exact binomial vs the z approximation
Textbooks once taught the sign test through the normal approximation because binomial sums were tedious by hand. They no longer are, and this calculator computes the exact tail by summing the binomial probabilities directly: for the first example, the probability of 8 or fewer of the rarer sign in 25 fair trials is 0.0539, doubled to the two-sided 0.1078. The corrected z of 1.600 is shown so results can be compared with older literature that reports only the approximation.
The gap between exact and approximate widens as pairs get few or the split gets extreme. The second worked example - 9 positive against 21 negative, 30 pairs - gives an exact p of 0.0428 with a corrected z of -2.008; the third, a near-tie of 14 against 13, returns exactly 1.0000, the p-value's way of saying the data are as consistent with the null as data can be.
- Count a pair as positive when the second measurement exceeds the first; zero differences are ties and leave the analysis entirely.
- The exact binomial calculation is preferred at every sample size - the z is a comparison aid, not the headline.
- One-sided tests are legitimate when the direction was predicted in advance; the calculator shows the one-sided tail separately.
- The sign test also serves as a median test for a single sample against a hypothesised value.
- Power, not validity, is what the sign test trades away - with abundant clean data, prefer signed-rank.
Worked examples
Example 1: Positive differences 17; Negative differences 8. Sign test p-value (two-sided) = 0.1078. Supporting values: Effective pairs (ties excluded) 25; One-sided exact tail 0.0539; z (normal approx, corrected) 1.600. Effective pairs: 17 positive differences against 8 negative ones give 25 informative pairs - ties are discarded before anything else happens. Exact binomial tail: under the null each pair is a fair coin, so the probability of 8 or fewer of the rarer sign is 0.0539 from the binomial sum. Doubling: the two-sided p-value is 2 x 0.0539 = 0.1078; the continuity-corrected normal approximation gives z = 1.600 for comparison. Sign test result: p = 0.1078 - the oldest nonparametric test there is, using direction alone and no magnitudes at all.
Example 2: Positive differences 9; Negative differences 21. Sign test p-value (two-sided) = 0.0428. Supporting values: Effective pairs (ties excluded) 30; One-sided exact tail 0.0214; z (normal approx, corrected) -2.008. Effective pairs: 9 positive differences against 21 negative ones give 30 informative pairs - ties are discarded before anything else happens. Exact binomial tail: under the null each pair is a fair coin, so the probability of 9 or fewer of the rarer sign is 0.0214 from the binomial sum. Doubling: the two-sided p-value is 2 x 0.0214 = 0.0428; the continuity-corrected normal approximation gives z = -2.008 for comparison. Sign test result: p = 0.0428 - the oldest nonparametric test there is, using direction alone and no magnitudes at all.
Example 3: Positive differences 14; Negative differences 13. Sign test p-value (two-sided) = 1.0000. Supporting values: Effective pairs (ties excluded) 27; One-sided exact tail 0.5000; z (normal approx, corrected) 0.000. Effective pairs: 14 positive differences against 13 negative ones give 27 informative pairs - ties are discarded before anything else happens. Exact binomial tail: under the null each pair is a fair coin, so the probability of 13 or fewer of the rarer sign is 0.5000 from the binomial sum. Doubling: the two-sided p-value is 2 x 0.5000 = 1.0000; the continuity-corrected normal approximation gives z = 0.000 for comparison. Sign test result: p = 1.0000 - the oldest nonparametric test there is, using direction alone and no magnitudes at all.
Sign test vs Wilcoxon signed-rank
The choice is about how much of the data you trust. If the differences' magnitudes are meaningful and roughly symmetric, Wilcoxon's test uses them and will find effects the sign test misses - its worked examples on this site show the rank machinery. If magnitudes are distorted by outliers, censoring, or an instrument that saturates, those same ranks become liabilities, and the sign test's refusal to look at them becomes its virtue.
A practical diagnostic: run both. When they agree, report either with confidence. When Wilcoxon is significant and the sign test is not, the effect lives in the magnitudes - inspect them before believing it, because a few large pairs may be carrying the result. When the sign test is the significant one (rarer), the direction is consistent but the magnitudes are fighting it, an equally informative pattern.
The sign test in practice
Clinical and quality settings generate sign-test data naturally: patients better or worse after treatment when the outcome scale is ordinal, products preferred or not in paired tastings, gauges reading high or low against a standard. In each case the direction is recorded faithfully and the magnitude is dubious - the test's home ground.
For an audit of the arithmetic, the first example is complete: 17 plus, 8 minus, 25 pairs, one-sided tail 0.0539, two-sided 0.1078. Any package that returns a different exact value for those counts has either kept the ties in or approximated - both discoverable only because the exact calculation is simple enough to check by hand, which is, in the end, the sign test's enduring charm.
Reading the three examples
The first example teaches the test's conservatism: a better than two-to-one split (17 against 8) still yields 0.1078, short of conventional significance, because 25 pairs is modest evidence when each pair contributes a single bit. Researchers surprised by that gap between the headline ratio and the p-value have usually overestimated how much information direction alone carries.
The second example crosses the line - 9 against 21 gives 0.0428 - on a similar pair count but a more lopsided split, and the third sits at the null's exact centre. Together they calibrate the intuition the test demands: it is the count of pairs and the balance together, never the ratio alone, that decide.
The same machinery doubles as a one-sample median test: count how many observations fall above a hypothesised median against how many fall below, discard the ones sitting exactly on it, and the binomial calculation proceeds identically. That dual use explains the test's survival in quality control and clinical audit, where the question is so often 'is the typical value where we claim it is?' asked of data too skewed or too coarsely recorded for mean-based tests. Direction and count, honestly handled, answer more real questions than their simplicity suggests.
FAQs
What p-value does the first example give?
0.1078 - the exact two-sided binomial value for 17 positive against 8 negative differences (25 effective pairs), doubled from a one-sided tail of 0.0539.
How many effective pairs does it use?
25: the 17 positive and 8 negative differences, with any tied pairs excluded before counting, as the test requires.
What z approximation accompanies it?
1.600, the continuity-corrected normal approximation - close to the exact answer here, and shown for comparison with textbook tables.
What p-value does the lopsided example give?
0.0428 for 9 positive against 21 negative differences - significant at the conventional threshold, on the strength of the split across 30 pairs.
What happens to tied pairs in a sign test?
They are discarded before the analysis and reduce the effective pair count; a zero difference carries no directional evidence either way.
What p-value does the near-tie example return?
1.0000 for 14 against 13 - the maximum possible p-value, data as consistent with the null hypothesis as data can be.