Sign Test Calculator

Perform the Sign Test — a robust nonparametric hypothesis test for paired samples and median comparisons.Compute test statistics, exact p‑values (binomial distribution), and interpret results with clear visual feedback.

Each value must be a real number. Pairs are matched by position.
Must have the same number of observations as Group 1.
(significance threshold)
Load example:
? Drug efficacy (paired)
⚖️ Weight loss program
? Tutoring impact
? No effect (null true)
? Small sample (n=8)
Privacy first: All calculations are performed locally in your browser. No data is sent to any server.

What Is the Sign Test?

The Sign Test is a fundamental nonparametric (distribution‑free) statistical test used to assess whether two paired samples come from populations with the same median — or equivalently, whether the median of the differences between paired observations is zero. It is one of the oldest and simplest hypothesis tests, dating back to the work of John Arbuthnot (1710) who used a sign test to examine the ratio of male to female births.

Unlike the paired t‑test, the Sign Test does not assume that the differences are normally distributed. It only requires that the observations are paired and that the differences are independent and continuous (so ties are rare). This makes it robust and widely applicable in medicine, psychology, education, economics, and engineering — wherever before‑after or matched‑pair data arise.

For each pair i, let di = yixi. Define
S+ = count(di > 0),   S = count(di < 0),   n = S+ + S.
Under H₀: median difference = 0,   S+ ~ Binomial(n, 0.5).

When to Use the Sign Test

  • Paired data: Before‑after studies, matched pairs, repeated measurements.
  • Non‑normal distributions: When the normality assumption of the t‑test is violated or questionable.
  • Ordinal data: When differences can only be ranked (e.g., Likert scales, preference scores).
  • Small samples: The exact binomial test works even with small n (though power is limited).
  • Outliers: The Sign Test is resistant to outliers because it uses only the direction (sign) of differences, not their magnitude.

Step‑by‑Step Computation

  1. Form pairs: Match each observation in Group 1 with the corresponding observation in Group 2.
  2. Compute differences: di = yixi.
  3. Discard ties: Remove pairs with di = 0. Let n be the number of non‑zero differences.
  4. Count signs: Let S⁺ = number of positive differences, S⁻ = number of negative differences.
  5. Test statistic: S = min(S⁺, S⁻) for the two‑sided test. For one‑sided tests, use S⁺ or S⁻ directly.
  6. p‑value: Under the null hypothesis H₀: median difference = 0, S⁺ ~ Binomial(n, 0.5). The p‑value is computed exactly from the binomial distribution.
  7. Decision: Reject H₀ if p‑value ≤ α (significance level).

The exact p‑value for the two‑sided test is p = 2 × P( X ≤ S ) where X ~ Binomial(n, 0.5) and S = min(S⁺, S⁻). For the one‑sided test (greater), p = P( X ≥ S⁺ ); for the one‑sided test (less), p = P( X ≤ S⁺ ). Our calculator uses exact binomial probabilities (not normal approximation) for all sample sizes.

Real‑World Case Study: Evaluating a New Teaching Method

Case Study: Online Tutoring Impact on Exam Scores

A school district implemented an online tutoring program for 12 students who were struggling in mathematics. Each student's score (out of 100) was recorded before the program and after 8 weeks of tutoring. The data (before, after) were: (62, 68), (71, 74), (55, 62), (80, 82), (67, 70), (73, 78), (58, 60), (69, 72), (76, 79), (64, 66), (70, 74), (61, 63).

Analysis: The differences (after − before) are all positive: +6, +3, +7, +2, +3, +5, +2, +3, +3, +2, +4, +2. S⁺ = 12, S⁻ = 0, n = 12. Under H₀ (no improvement), the probability of observing all 12 positive signs is (0.5)¹² ≈ 0.000244. The two‑sided p‑value is 2 × 0.000244 = 0.000488. At α = 0.05, we reject H₀ and conclude that the tutoring program significantly improved scores.

Insight: The Sign Test provides strong evidence of improvement without requiring normality. The magnitude of improvement (e.g., +6 vs. +2) is ignored — only the direction matters. This simplicity is both a strength (robustness) and a limitation (loss of power compared to the t‑test when normality holds).

Comparison with Other Tests

Test Data type Assumptions Strength Limitation
Sign Test Paired / matched Independent differences, continuous (ties allowed) Robust, non‑parametric, simple Lower power than t‑test when normality holds
Wilcoxon Signed‑Rank Test Paired / matched Symmetry of differences, continuous More powerful than Sign Test (uses ranks) Requires symmetry assumption
Paired t‑test Paired / matched Normal differences Most powerful when assumptions met Not robust to non‑normality or outliers
McNemar's Test Paired binary outcomes Binary data Specific for 2×2 contingency tables Only for binary outcomes

Common Misconceptions

  • “The Sign Test requires normally distributed data.” — False. The Sign Test is distribution‑free and makes no normality assumption.
  • “The Sign Test is only for small samples.” — False. It works for any sample size. For very large n, the binomial distribution can be approximated by the normal distribution, but our calculator uses exact binomial probabilities.
  • “Ties (zero differences) should be counted as positive.” — No. Ties are discarded because they provide no information about the direction of the difference. This reduces the effective sample size.
  • “The Sign Test and the t‑test always give the same conclusion.” — Not necessarily. When the normality assumption is violated, the t‑test may be unreliable, while the Sign Test remains valid.

Expert Commentary & Historical Context

The Sign Test is one of the oldest statistical tests, with roots in the 18th‑century work of John Arbuthnot (1710) who used it to demonstrate divine providence by showing that male births slightly outnumbered female births in London. In the 20th century, the test was formalized by Frank Wilcoxon (1945) and Henry Mann & Donald Whitney (1947) as part of the development of nonparametric statistics. Today, it remains a cornerstone of introductory statistics courses and is widely used in clinical trials, quality control, and behavioral sciences.

Frequently Asked Questions

The null hypothesis (H₀) is that the median of the differences between paired observations is zero. Equivalently, P(difference > 0) = P(difference < 0) = 0.5. This means that positive and negative differences are equally likely.

Pairs with zero difference are discarded from the analysis. They provide no information about the direction of the effect. This reduces the effective sample size n (the number of non‑zero differences). The binomial distribution is then based on this reduced n.

A two‑sided test checks whether the median difference is different from zero (either positive or negative). A one‑sided test (greater) checks whether the median difference is greater than zero (i.e., Group 2 tends to be larger than Group 1). A one‑sided test (less) checks whether the median difference is less than zero. Choose the alternative hypothesis based on your research question.

The exact binomial p‑value is accurate for all sample sizes, including small samples where the normal approximation may be poor. Our calculator uses exact binomial probabilities (computed via cumulative distribution function) to ensure correctness. For large samples, the exact and approximate p‑values converge, but we prioritize accuracy.

Yes. The one‑sample Sign Test compares the median of a single sample to a specified value. To use our paired‑sample calculator for one‑sample testing, create a second group where every value equals the hypothesized median. Then the differences are (observation − median), and the test checks whether the median of the sample differs from the specified value.

References: Conover, W.J. (1999). Practical Nonparametric Statistics, 3rd ed. Wiley. Hollander, M., Wolfe, D.A., & Chicken, E. (2014). Nonparametric Statistical Methods, 3rd ed. Wiley. MathWorld Sign Test; Wikipedia: Sign Test.