Consider a random sample of size \(n\) from a continuous distribution having
median 0 so that the probability of any one observation being positive is .5.
Disregarding the signs of the observations, rank them from smallest to largest
in absolute value, and let \(W=\) the sum of the ranks of the observations
having positive signs. For example, if the observations are \(-.3,+.7,+2.1\),
and \(-2.5\), then the ranks of positive observations are 2 and 3 , so \(W=5\). In
Chapter \(15, W\) will be called Wilcoxon's signed-rank statistic. W can be
represented as follows: a. Determine \(E(Y)\) and then \(E(W)\) using the equation
for \(W\). [Hint: The first \(n\) positive integers sum to \(n(n+1) / 2 .]\)
b. Determine \(V\left(Y_{i}\right)\) and then \(V(W)\). [Hint: The sum of the
squares of the first \(n\) positive integers can be expressed as \(n(n+1)(2 n+1)
/ 6\).]
$$
\begin{aligned}
W &=1 \cdot Y_{1}+2 \cdot Y_{2}+3 \cdot Y_{3}+\cdots+n \cdot Y_{n} \\
&=\sum_{i=1}^{n} i \cdot Y_{i}
\end{aligned}
$$
where the \(Y_{i}\) 's are independent Bernoulli rv's, each with
\(p=.5\left(Y_{i}=1\right.\) corresponds to the observation with rank \(i\) being
positive).