Wilcoxon signed-rank statistic (source code)

= Wilcoxon signed-rank statistic
{c}
{title2=$W_+=\sum_{X_i>0}\operatorname{rank}(|X_i|)$}

For a continuous sample, the statistic also equals $\sum_i\mathbf1_{\{X_i>0\}}+\sum_{i<j}\mathbf1_{\{X_i+X_j>0\}}$. In each pair the sign of the sum is the sign of the observation with larger absolute value, proving the identity by counting its smaller-rank partners. Under a continuous symmetric null, the pair kernel has projection $F(x)-1/2$ and projection <variance> $1/12$. The <U-statistic central limit theorem> yields <asymptotic normality> of $W_+$, with <variance> asymptotic to $n^3/12$.