8.2 The Variance of \(S\), With Ties

For \(n \geq 8\) the distribution of \(S\) is well approximated by a normal distribution with

\[\operatorname {var}(S) = \dfrac {1}{18}\left [ n(n-1)(2n+5) - \sum _{p} t_p\left (t_p - 1\right )\left (2t_p + 5\right )\right ],\]

where the sum runs over the groups of tied values and \(t_p\) is the size of the \(p\)-th tied group. With no ties every \(t_p = 1\), each term vanishes, and the variance reduces to \(\dfrac {n(n-1)(2n+5)}{18}\).

The test statistic uses a continuity correction, and the direction of that correction depends on the sign of \(S\):

\[Z = \begin {cases} \dfrac {S - 1}{\sqrt {\operatorname {var}(S)}} & S > 0,\\[10pt] \ \ 0 & S = 0,\\[6pt] \dfrac {S + 1}{\sqrt {\operatorname {var}(S)}} & S < 0. \end {cases}\]

Subtracting \(1\) when \(S > 0\) and adding \(1\) when \(S < 0\) both move \(Z\) towards zero. The correction is conservative by construction: it can only ever make a trend harder to declare, never easier. Reject \(H_0\) at level \(\alpha \) against a two-sided alternative when \(\left |Z\right | > Z_{\alpha /2}\).

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.