Sign Test Calculator
The sign test is the simplest of the nonparametric tests: it looks only at the sign of the difference between two paired measurements and ignores its magnitude entirely. The null hypothesis states that positive and negative differences are equally likely (P = 0.5), and the p-value is computed EXACTLY from the Binomial(n; 0.5) distribution, with no approximation involved.
Because it does not use the size of the differences, it is less powerful than the Wilcoxon signed-rank test; in exchange it requires no symmetry assumption at all and is completely unaffected by extreme values. This calculator reports the number of plus, minus, and zero (tied) differences, the statistic S = min(plus, minus), the exact two-tailed binomial p-value, a continuity-corrected normal approximation for comparison, a distribution-free confidence interval for the median difference, a sign table, and bar charts.
Sign Test Formulas
Differences: dᵢ = xᵢ − yᵢ (pairs with dᵢ = 0 are dropped) Effective n: n = (number of plus) + (number of minus) Test statistic: S = min(plus, minus) Null hypothesis: H₀: P(d > 0) = P(d < 0) = 0.5 EXACT p-value: p = 2 · P(X ≤ S) , X ~ Binomial(n; 0.5) Binomial mass: P(X = i) = C(n, i) · 0.5ⁿ Normal approx.: z = (|plus − n/2| − 0.5) / (√n / 2) Median interval: [ d₍ₖ₎ , d₍ₙ₊₁₋ₖ₎ ] , P(X ≤ k − 1) ≤ α/2
Because the Binomial(n; 0.5) distribution is symmetric, the two-tailed p is obtained EXACTLY by doubling the one-tailed probability; no approximation is used. The normal approximation is given only for comparison and converges to the exact value around n ≥ 25. Dropping the zero differences is standard practice.
How to Calculate
- Choose the comparison type: paired mode for two measurements on the same subjects, one-sample mode to compare a single data set against a median value.
- In paired mode, enter the two measurements in the same order with an equal number of values; in one-sample mode, enter the data set and the median (M₀) to be tested.
- Set the significance level (α); the critical S value and the median confidence interval are computed at that level.
- Read the plus, minus, and zero counts; zero differences are excluded from the test and shrink the effective sample.
- Base your decision on the EXACT binomial p-value; the normal approximation row is only for comparison and is misleading in small samples.
- If the differences are symmetric around their median, run the same data through the Wilcoxon signed-rank test as well: because it uses the size of the differences, it gives a more powerful result.
Worked Examples
Pain score before and after treatment
In 14 of the 15 patients the pain score dropped and in 1 it stayed the same; once the zero difference is dropped, the effective n = 14 and S = 0. The exact binomial p = 2·0.5¹⁴ = 0.000122, so the decrease is statistically significant. The median of the differences is −3.00 and the 95% confidence interval for the median difference runs from −4 to −1; the critical value for α = 0.05 is S ≤ 2.
S test statistic: 0 · Number of plus signs: 0 · Number of minus signs: 14
No difference between two measurement methods
Of the 12 pairs, 6 increased and 6 decreased; with S = 6 and an exact binomial p = 1.000 there is no systematic difference between the two methods. The proportion of positive differences is exactly 50%. This example shows the logic of the sign test clearly: only the directions of the differences are counted, never their magnitudes.
S test statistic: 6 · Number of plus signs: 6 · Number of minus signs: 6
One sample — is the median different from 50?
Of the 12 observations, 8 lie above 50 and 4 below; S = 4 and the exact binomial p = 0.388. There is no basis for concluding that the median differs from 50. Even though the proportion of positive differences is 66.7%, 12 observations are not enough to make that departure significant — the low power of the sign test is plain to see here.
S test statistic: 4 · Number of plus signs: 8 · Number of minus signs: 4