Discard zero differences and use the binomial sign-count model.
Notes and key methods
A sign test for a continuous population median counts observations above and below the null median. Under H₀, each nonzero difference is equally likely to be positive or negative, so the positive count is Bin(n,1/2).
For paired data, first calculate differences in the stated order. Remove zero differences before fixing n. The sign test uses direction alone and does not require the symmetry assumption needed by the signed-rank test.
Check the conditions
Pairs or observations are independently sampled.
Discard exact zeros before counting the effective sample size.
Three worked examples
Example 1 · Exact sign tests
After removing zero differences, 10 independent paired differences contain 7 positive and 3 negative values. The alternative is a positive population median difference.
Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.
Find the expected positive count under H₀.
Find the exact one-sided p-value.
Find the exact two-sided p-value using twice the smaller tail, capped at one.
If three exact zero differences had also been recorded, find the original number of pairs.
Show the reasoning
(a)
\(n/2=5\)
Answer: \(5\).
(b)
\(P(\operatorname{Bin}(10,1/2)\ge 7)=0.171875\)
Answer: \(0.171875\).
(c)
\(\min(1,2p_{\rm one-sided})=0.34375\)
Answer: \(0.34375\).
(d)
\(10+3=13\)
Answer: \(13\).
The p-value is \(0.171875\). Since it exceeds 0.05, do not reject H₀: the sample gives insufficient evidence that the population median difference is positive. This does not give the probability that H₀ is true.
Example 2 · Exact sign tests
After removing zero differences, 11 independent paired differences contain 10 positive and 1 negative values. The alternative is a positive population median difference.
Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.
Find the expected positive count under H₀.
Find the exact one-sided p-value.
Find the exact two-sided p-value using twice the smaller tail, capped at one.
If three exact zero differences had also been recorded, find the original number of pairs.
The p-value is \(0.005859375\). Since it is at most 0.05, reject H₀: there is evidence that the population median difference is positive. This does not give the probability that H₀ is true.
Example 3 · Exact sign tests
After removing zero differences, 12 independent paired differences contain 10 positive and 2 negative values. The alternative is a positive population median difference.
Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.
Find the expected positive count under H₀.
Find the exact one-sided p-value.
Find the exact two-sided p-value using twice the smaller tail, capped at one.
If three exact zero differences had also been recorded, find the original number of pairs.
The p-value is \(0.019287109375\). Since it is at most 0.05, reject H₀: there is evidence that the population median difference is positive. This does not give the probability that H₀ is true.
Common mistakes
Do not rank magnitudes for a sign test.
A two-sided p-value must account for both extreme directions.