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.
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 = yi − xi.
Define
S+ = count(di > 0),
S− = count(di < 0),
n = S+ + S−.
Under H₀: median difference = 0, S+ ~ Binomial(n, 0.5).
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.
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).
| 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 |