---
tag: G20KZ755WW
kind: definition
name: Sign test
msc: [62G10]
defines: NBK6G2VB7A
uses: [087P03NEND, 08W2CW8PKW, 0VRWZDWW6B, 0AJN7WHBJZ]
sources:
  - url: https://en.wikipedia.org/wiki/Sign_test
---

## Definition

Let $X_1, \dots, X_n$ be [[i.i.d.|0AJN7WHBJZ]] real random variables with a continuous distribution, and let $m$ be its [[median|08W2CW8PKW]].
Let $m_0 \in \R$.
The *sign statistic* is
$$S = \#\set{i : X_i > m_0}.$$
The *sign test* of $H_0 \colon m = m_0$ uses the fact that under $H_0$ the statistic $S$ has the [[binomial distribution|0VRWZDWW6B]] with parameters $n$ and $1/2$.
Against $H_1 \colon m > m_0$ it rejects $H_0$ for large $S$, against $m < m_0$ for small $S$, and against $m \ne m_0$ for $S$ far from $n/2$.

## Remarks

For matched pairs $(Y_i, Z_i)$ one applies the test to the differences $X_i = Y_i - Z_i$ with $m_0 = 0$.
Continuity of the law gives $P(X_i = m_0) = 0$; with real data, observations equal to $m_0$ are usually dropped and $n$ is reduced.

Example: $n = 10$ observations, all above $m_0$, so $S = 10$.
The one-sided p-value is $P(S \ge 10) = 2^{-10} \approx 0.001$ under $H_0$, and $H_0$ is rejected at level $0.05$.

Non-example: let $P(X_i < m_0) = P(X_i > m_0) = 1/4$ and $P(X_i = m_0) = 1/2$.
Then $m_0$ is a median, but the law is not continuous, and $S$ has law $\mathrm{Bin}(n, 1/4)$ instead of $\mathrm{Bin}(n, 1/2)$.

The [[Wilcoxon signed-rank test|38SETDT2HN]] also uses the sizes of the deviations $X_i - m_0$, at the cost of assuming symmetry.
