Walsh average (source code)

= Walsh average
{c}
{title2=$(X_i+X_j)/2$}

The Walsh averages of a sample are $(X_i+X_j)/2$ for $1\le i\le j\le n$, including the diagonal pairs. If the absolute observations are distinct and nonzero, order them as $|X_{(1)}|<\cdots<|X_{(n)}|$. Among the $r$ pairs whose larger absolute observation is $X_{(r)}$, every sum has the sign of $X_{(r)}$. Hence the number of positive Walsh averages is exactly $\sum_r r\mathbf1_{X_{(r)}>0}$, the positive <Wilcoxon signed-rank statistic>. This proves equivalence of the corresponding tests; the Walsh averages themselves are generally dependent.