Sign Test Calculator
Enter two paired lists, or one list and a hypothesised median, and get the sign test: how many differences are positive, negative, or zero, an exact binomial p-value for any alternative, the share of positive differences with a Clopper–Pearson interval, and a distribution-free confidence interval for the median. Each sign is listed and the binomial working is shown. Free, no sign-up.
0 values
0 values
Differences are first − second (or value − median).
Enter the two measurements in matching order — the same number of values in each box.
How to Use the Sign Test Calculator
- 1. Choose the input. For paired data, paste the first and second measurement in matching order. For a single sample, paste the values and set the median you want to test against.
- 2. Pick the alternative. Two-sided asks whether the median difference is not zero; the one-sided choices ask whether it is negative or positive. Differences are first − second.
- 3. Read the counts and p. The calculator counts positive and negative differences, drops zeros, and gives the exact binomial p-value.
- 4. Use the intervals. The share of positive differences and the median difference come with confidence intervals. Copy the APA line when you are done.
How the Sign Test Works
The sign test throws away the size of each difference and keeps only its direction. If the median difference is really zero, a difference is as likely to be positive as negative, so among the n differences that are not zero, the number of positives, n⁺, follows a Binomial(n, ½) distribution. The p-value is a binomial tail: P(X ≥ n⁺) for the "positive" alternative, P(X ≤ n⁺) for the "negative" one, and twice the smaller tail (capped at 1) for the two-sided test. Because it uses exact binomial probabilities, it needs no large-sample approximation and works with any n.
Zero differences give no direction, so they are dropped and n is reduced; the calculator reports how many it removed. For a one-sample test, subtract the hypothesised median from each value and count signs the same way. The distribution-free confidence interval for the median uses order statistics: with N sorted values, the interval from the kth smallest to the kth largest has coverage 1 − 2·P(X ≤ k − 1), and the calculator picks the narrowest one that reaches your confidence level and reports its actual coverage.
Worked Example: Scores Before and After a Workshop
Click Try an example to load scores for 12 students before and after a writing workshop. Differences (before − after) are positive for 9 students, negative for 1, and zero for 2, so the test uses n = 10.
Sign test, step by step
n⁺ = 9, n⁻ = 1, zeros = 2 → n = 10, X ~ Binomial(10, ½)
P(X ≤ 1) = (1 + 10) / 1024 = 0.0107
Two-sided p = 2 × 0.0107 = 0.0215
Share positive = 0.90, exact 95% CI [0.555, 0.997]; median difference = 5.5
In APA style: a sign test showed that scores fell after the workshop, S = 9, n = 10, exact p = .021. The distribution-free 96.1% interval for the median difference runs from 0 to 9 — it cannot hit exactly 95% with 12 values, which is why the actual coverage is shown.
Sign Test or Another Test?
| Situation | Better choice |
|---|---|
| Paired differences are roughly normal | Paired t-test, which uses the size of each difference |
| Paired differences are symmetric but not normal | Wilcoxon signed-rank test, which also uses the ranks of the sizes |
| Only the direction is known (better, worse, same), or the differences are very skewed | Sign test |
| A success/failure outcome against a fixed probability | Binomial test |
| Paired yes/no outcomes | McNemar's test, which is a sign test on the discordant pairs |
Frequently Asked Questions
- What is the sign test used for?
- It tests whether the median difference between paired measurements is zero, or whether a single sample's median equals a stated value. It only needs to know whether each difference is positive or negative, so it works with ordinal ratings, badly skewed data, and cases where the size of a difference is unreliable.
- How do I handle ties and zero differences?
- Drop them. A pair with identical values has no direction, so it carries no evidence for or against a shift, and the sign test counts only the n pairs that differ. Dropping many zeros costs power, and it changes what the test is about: it compares the pairs that moved, not all pairs.
- Is the sign test less powerful than the t-test or Wilcoxon?
- Yes, when their assumptions hold. For normally distributed differences the sign test has an asymptotic relative efficiency of 2/π, about 64%, against the paired t-test, and it is also less powerful than the Wilcoxon signed-rank test for symmetric data. It earns its place when those assumptions are doubtful or only the direction was recorded.
- How do I report a sign test in APA style?
- State the number of positive differences, the number of pairs that differed, and the exact p-value: S = 9, n = 10, exact p = .021. Mention that zero differences were dropped, and report the median difference or the medians of both conditions alongside the test.
- What is the difference between the sign test and the binomial test?
- The sign test is a binomial test with a fixed null probability of one half, applied to the signs of differences. The general binomial test lets you test any hypothesised probability, such as whether 30% of respondents agree. The p-value calculation is the same exact binomial tail.
- Can I run a one-sided sign test?
- Yes. Choose the alternative before you look at the data: "positive" counts the upper binomial tail, "negative" the lower one. A one-sided p-value is half the two-sided value when the counts lean in the direction you predicted, which is why the choice has to be made in advance.