The sign test is a nonparametric statistical test used to determine whether there is a consistent difference between paired observations, or whether the median of a single sample differs from a hypothesized value. It relies only on the direction (sign) of each observation or difference relative to a reference value, ignoring magnitude. Because it makes few assumptions about the underlying distribution of the data, it has broad applicability, but it generally has less statistical power than parametric alternatives such as the paired t-test or the Wilcoxon signed-rank test.
Method
Paired-sample form
Given n pairs of observations (xi, yi), the differences di = yi − xi are computed and classified as positive, negative, or zero. Pairs with zero differences are conventionally omitted, yielding a reduced sample of m nonzero pairs. The null hypothesis is that a positive difference and a negative difference are equally likely; that is, H₀: p = 0.50, where p = Pr(X > Y).
Let W be the number of pairs with positive differences. Under H₀, W follows a binomial distribution, W ~ B(m, 0.5). The test statistic is W (or the smaller of the counts of positive and negative signs for a two-sided test). Because the test statistic is binomially distributed, significance is computed using binomial probabilities, with a normal approximation sometimes used for large samples (roughly m > 25).
- Left-tailed alternative (H₁: p < 0.50): p-value = Pr(W ≤ w).
- Right-tailed alternative (H₁: p > 0.50): p-value = Pr(W ≥ w).
- Two-sided alternative: p-value = twice the smaller tail probability.
One-sample form
For a single sample, each observation is compared with a hypothesized median η₀: values above η₀ receive a "+" sign, values below receive a "−" sign, and values equal to η₀ are treated as ties (typically omitted). The number of observations exceeding η₀, sometimes denoted S⁺, then has a binomial distribution with parameters n and p = 0.5 under the null hypothesis that the population median equals η₀. Hypotheses take the form H₀: η = η₀ versus a one- or two-sided alternative.
Assumptions
- The paired differences are independent.
- Each difference is drawn from a continuous population (or observations are at least ordinal, so that "greater than", "less than", and "equal to" are meaningful).
- The sample is randomly selected, and for the paired form the observations within each pair are dependent (matched).
The test does not require normality or symmetry of the underlying distribution, which distinguishes it from the paired t-test (which assumes normally distributed differences) and the Wilcoxon signed-rank test (which assumes a symmetric distribution of differences).
Example
Zar's frequently cited example compares the left hind leg length and left foreleg length of 10 deer. Eight deer had a longer hind leg and two had a longer foreleg, giving m = 10 nonzero differences and W = 8. Under H₀ with a fair-coin analogy, the two-sided probability of a result as extreme as 8 positives out of 10 is approximately 0.109, so the null hypothesis is not rejected at the 0.05 level. With 9 of 10 positive differences, the two-sided p-value would be about 0.0215, which would be significant. Because the leg measurements are numeric, the paired t-test or Wilcoxon signed-rank test would generally be more powerful in this case.
Relation to other tests
- Binomial test: The sign test is a special case of the binomial test with null probability p = 0.5, and is accordingly available in most statistical software through binomial procedures.
- Wilcoxon signed-rank test: When observations can be ranked, the Wilcoxon test uses magnitude information and is generally more powerful, with an asymptotic relative efficiency of approximately 0.67 relative to the sign test under its assumptions. However, if the distribution of differences is heavy-tailed, the sign test can be more powerful than both the paired t-test and the Wilcoxon signed-rank test.
- McNemar's test: When paired observations are binary (0/1 outcomes), the analogous procedure is known as McNemar's test.
- Friedman test: Used when comparisons involve three or more related conditions rather than two.
- Trinomial test: Proposed by Bian, McAleer, and Wong (2011) for paired data with many ties, reported to outperform the sign test in the presence of ties.
History
John Arbuthnot's 1710 analysis of London birth records from 1629 to 1710 — in which male births exceeded female births in every one of 82 years — is frequently cited as an early use of the sign test and as perhaps the first published report of a nonparametric test and an early example of a significance test. Nicholas Bernoulli subsequently analyzed Arbuthnot's data further.
Limitations
Because the sign test discards information about the magnitude of differences, it is generally less powerful than tests that use that information. Small samples yield low power to detect genuine differences, and the treatment of ties requires a specified convention; zero differences are commonly excluded from analysis. The test also does not estimate the size of any difference, only whether one is present.
Software
The sign test can be performed as a binomial test in most statistical packages. In R, the function binom.test(x, n, p = 0.5, alternative = ...) reproduces standard sign-test results. Dedicated procedures exist in packages such as Minitab (Stat > Nonparametrics > 1-Sample Sign) and various online calculators.