Tutorials › Propensity Score Matching and Instrumental Variables › Wilcoxon Sensitivity Bounds for Continuous Outcomes

Rosenbaum Bounds and E-Values · Tutorial 336 of 699

Wilcoxon Sensitivity Bounds for Continuous Outcomes

Construct worst-case one-sided and conservative two-sided Wilcoxon signed-rank p-value bounds under hidden bias, with careful treatment of ties and zero differences.

Advanced 12 min read

What You'll Learn

  • Define the signed-rank statistic for paired continuous outcomes under a sharp null.
  • Apply Rosenbaum’s Γ bound to the probability of a favorable sign in each pair.
  • Calculate exact worst-case tail probabilities using the signed ranks.
  • Rank tied nonzero differences correctly and exclude zero differences.
  • Construct a conservative two-sided bound and explain its interpretation.
  • Diagnose when exact calculations or the matched-pair model may be unreliable.

Why Bound a Signed-Rank Test?

Matched-pair analyses of continuous outcomes can use both the direction and the relative magnitude of pair differences. The Wilcoxon signed-rank statistic does this by adding ranks for differences in a chosen direction. But matching on measured covariates does not rule out hidden differences within pairs. Rosenbaum’s Γ model asks how much an unmeasured factor could alter the odds that one member of a pair receives treatment, then bounds the test’s p-value over all assignment probabilities allowed by that model.

The result is a sensitivity bound, not a correction that identifies the effect of the hidden factor. A large worst-case p-value means the observed evidence could be less compelling under some allowed assignment mechanism; it does not show that such a mechanism occurred. The test below concerns the sharp null of no treatment effect for any individual, conditional on the matched pairs.

Statistic, Assignment Model, and Assumptions

Definition: For pair \(i\), let \(D_i\) be the treated member’s outcome minus the control member’s outcome. Under the sharp null, the two members’ outcomes do not depend on treatment, so the pair’s outcome difference in the observed treatment orientation has a fixed absolute magnitude and a sign that can change if treatment assignment is reversed. Remove pairs with \(D_i=0\). Rank the absolute values of the remaining differences from smallest to largest, assigning tied absolute values their average rank. Write \(r_i\) for pair \(i\)’s rank and \(B_i=1\) if its difference is positive, \(0\) otherwise. The Wilcoxon positive-rank statistic is \(W^+=\sum_i r_iB_i\).

Let \(m\) be the number of nonzero pair differences. Rosenbaum’s Γ model bounds the treatment assignment odds within each matched pair. Conditional on exactly one treated member in each pair, the probability that the member with a particular fixed outcome ordering is treated is between \(1/(1+\Gamma)\) and \(\Gamma/(1+\Gamma)\), where \(\Gamma\geq1\). The case \(\Gamma=1\) corresponds to equal assignment odds within every pair. Larger Γ permits greater hidden bias.

For the calculation, assume the pair assignments are conditionally independent and that the sharp null holds. Under the null, reversing which member of a pair is treated reverses that pair’s signed difference without changing its absolute value or rank. The model permits the probability of a positive sign to vary by pair, but constrains each such probability to the interval above. These assumptions make the ranks fixed and the uncertainty in \(W^+\) arise from the signs.

For a one-sided alternative that outcomes tend to be higher under treatment, the worst-case upper-tail p-value is the largest probability of observing a statistic at least as large as the observed \(w_{\mathrm{obs}}\), over all allowed pair assignment probabilities. The adverse choice for this upper tail sets the probability of a positive sign to its maximum, \(p_\Gamma=\Gamma/(1+\Gamma)\), for every nonzero pair. Thus the bounding distribution is

$$ W^+_\Gamma=\sum_{i=1}^{m} r_i B_i,\qquad B_i\ \text{independent},\quad B_i\sim\operatorname{Bernoulli}(p_\Gamma). $$

The worst-case upper-tail bound is \(P(W^+_\Gamma\geq w_{\mathrm{obs}})\). For a lower-tail alternative, use the same construction for negative signs: their probabilities are set to \(p_\Gamma\), equivalently positive signs have probability \(1/(1+\Gamma)\). Tail comparisons include equality, which matters when the statistic has a discrete distribution.

Why the Extremal Probability Gives a Bound

The justification is monotonicity. For the upper tail, write each sign indicator as \(B_i(p_i)=1\{U_i\leq p_i\}\), where the \(U_i\) are independent uniform random variables on \([0,1]\). If \(p_i\leq p_\Gamma\), then \(B_i(p_i)\leq B_i(p_\Gamma)\) for every value of \(U_i\). Since every rank is positive,

$$ \sum_i r_iB_i(p_i)\leq\sum_i r_iB_i(p_\Gamma). $$

Consequently, the event that the left-hand statistic reaches an upper threshold is contained in the corresponding event for the right-hand statistic. Its probability is therefore no greater. Setting every probability to \(p_\Gamma\) maximizes the upper tail over the allowed assignments. For a lower-tail test, apply the same argument to the negative-sign indicators, because the event of an unusually small \(W^+\) is an event of many negative signs. This proves the stated worst-case bounds under the model assumptions.

Worked Example: Ties and a Zero Difference

Suppose five hypothetical matched pairs have treated-minus-control outcome differences, measured in points, of \(+1,+2,-2,0,+4\). Test the one-sided alternative that treatment tends to increase the outcome, using \(\Gamma=2\).

First remove the zero difference. It contributes neither a positive nor a negative signed rank, so it receives no rank. Rank the four remaining absolute differences \(1,2,2,4\). The two tied values of 2 occupy ranks 2 and 3, so each receives their average, 2.5. The ranks in pair order are therefore 1, 2.5, 2.5, and 4. The observed statistic is

$$ w_{\mathrm{obs}}=1+2.5+4=7.5. $$

The rank 2.5 is negative and is not included. With \(\Gamma=2\), \(p_\Gamma=2/(1+2)=2/3\). The upper-tail event is that the sum of selected ranks is at least 7.5. Among the 16 subsets of ranks, it occurs for the three subsets containing three ranks that leave out rank 1 or either rank 2.5, and for the subset containing all four ranks. Its probability is

$$ P(W^+_\Gamma\geq7.5) =3p_\Gamma^3(1-p_\Gamma)+p_\Gamma^4 =3\left(\frac{2}{3}\right)^3\left(\frac{1}{3}\right) +\left(\frac{2}{3}\right)^4 =\frac{40}{81}\approx0.4938. $$

Thus, under the stated sharp null and assignment model, the worst-case one-sided p-value bound is approximately 0.494. The calculation uses the tied average ranks and omits the zero before ranking; counting the zero as a ranked observation would change the test statistic and its reference distribution.

Exact Calculation and a Sensitivity Comparison

With a modest number of nonzero pairs, enumerate the \(2^m\) possible sign patterns. For any pattern, add the ranks assigned positive signs and include its probability under the bounding distribution. For larger \(m\), a dynamic-programming calculation can update the probability of each attainable rank sum one pair at a time. Tied ranks can be fractional; multiplying all ranks by 2 converts half-integer ranks to integers without changing any tail probability.

Worked Example: How the Bound Changes With Γ

Use the ranks and observed statistic from the previous hypothetical data, so the upper-tail event requires a sum of at least 7.5 and occurs for three qualifying three-rank subsets and the all-ranks subset. At a general \(\Gamma\), its bound is

$$ 3p_\Gamma^3(1-p_\Gamma)+p_\Gamma^4,\qquad p_\Gamma=\frac{\Gamma}{1+\Gamma}. $$

At \(\Gamma=1\), \(p_\Gamma=1/2\), giving \(3(1/2)^3(1/2)+(1/2)^4=4/16=0.2500\). At \(\Gamma=2\), the bound is \(40/81\approx0.4938\), as calculated above. At \(\Gamma=3\), \(p_\Gamma=3/4\), giving \(3(3/4)^3(1/4)+(3/4)^4=162/256\approx0.6328\). The bound rises as the model permits stronger hidden bias. Each value is a worst-case tail probability at its specified Γ, not an estimate of the probability that hidden bias has that strength.

Two-Sided Tests and Direction

For a two-sided test, one common convention doubles the smaller one-sided tail probability and caps the result at 1. A conservative sensitivity bound can be formed by bounding each tail separately. Let \(U_+\) be the worst-case probability \(P(W^+\geq w_{\mathrm{obs}})\), and let \(U_-\) be the worst-case probability \(P(W^+\leq w_{\mathrm{obs}})\). Then a valid bound using this convention is

$$ \min\{1,\;2\min(U_+,U_-)\}. $$

The bound is conservative because the assignment probabilities that maximize the two tails need not be the same. It may therefore be larger than the largest two-sided p-value over any single allowed assignment mechanism. State the convention used, particularly when the discrete distribution puts substantial probability on the observed statistic.

Worked Example: A Lower-Tail Result and a Two-Sided Bound

For three hypothetical nonzero pairs, suppose the absolute differences are all distinct, so their ranks are 1, 2, and 3, and all three observed differences are negative. Then \(w_{\mathrm{obs}}=0\). For a one-sided alternative that treatment lowers the outcome, \(\Gamma=2\) allows each pair’s negative-sign probability to be as large as \(2/3\). The statistic is zero only if all three signs are negative, so

$$ P(W^+=0)\leq\left(\frac{2}{3}\right)^3 =\frac{8}{27}\approx0.2963. $$

This is the worst-case lower-tail bound. For the two-sided convention above, the upper-tail probability \(P(W^+\geq0)\) is 1, while the lower-tail bound is \(8/27\). The resulting conservative two-sided bound is \(\min\{1,2\min(1,8/27)\}=16/27\approx0.5926\). The result does not establish that the treatment lowers outcomes; it reports how much evidence this signed-rank test retains under the specified sensitivity model.

Diagnostics, Alternatives, and Limitations

Before interpreting a bound, check that the analysis follows the design and the statistic’s assumptions. In particular, verify that each pair contains the intended one treated and one control unit, that outcomes and treatment orientation are recorded consistently, and that the sharp-null comparison is the scientific null of interest. Inspect the pair differences: a coding error, an unexpected cluster of ties, or many zero differences can materially affect the statistic. Confirm that ties use average ranks and that zeros are removed before ranks are assigned.

Exact enumeration is preferable when feasible. A normal approximation to the signed-rank sum can be inaccurate with few nonzero pairs, many tied ranks, or a tail probability near a decision threshold. Under the bounding distribution with ranks \(r_i\), its mean and variance are

$$ E(W^+_\Gamma)=p_\Gamma\sum_i r_i,\qquad \operatorname{Var}(W^+_\Gamma)=p_\Gamma(1-p_\Gamma)\sum_i r_i^2. $$

These follow by adding the means and variances of independent Bernoulli-weighted ranks. They can support an approximation, but they do not remove discreteness or make a poor approximation exact. If used, report the approximation and any continuity correction; do not present it as an exact bound.

The signed-rank test uses the ordering of the magnitudes as well as their signs. A paired sign test uses only the number of positive and negative nonzero differences, so it may be less sensitive when magnitudes carry useful information, but it is less affected by the precise rank ordering. A paired t-test instead uses the numerical magnitudes and has different distributional requirements for its usual small-sample inference. None of these alternatives automatically addresses hidden bias: a sensitivity analysis requires specifying how assignment odds may differ within pairs.

A Γ-bound is conditional on the matched-pair design, the sharp null, and the assignment model; it does not account automatically for matching errors, outcome measurement problems, dependence across pairs, or uncertainty from selecting a matching procedure. It also does not identify the unmeasured covariate or tell whether the worst-case assignment probabilities are plausible. Report the chosen Γ values and the corresponding bounds, and interpret them as sensitivity of the test conclusion to a stipulated degree of hidden bias.

Common Pitfall

Key takeaway: Do not assign rank 1, 2, 3, and so on before removing zero differences or resolving ties. The correct order is to omit zero differences, rank the remaining absolute differences, average ranks within ties, and then sum ranks for positive signs. Also, a worst-case bound is not the p-value under a known assignment mechanism: it is the largest permitted tail probability under the specified Γ model.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Four nonzero absolute differences are 1, 3, 3, and 8. What ranks do they receive?
  2. For \(\Gamma=1\), what is the maximum allowed probability of a positive sign in a pair?
  3. Why is a zero difference excluded before assigning signed ranks?
  4. If the one-sided upper-tail bound increases from 0.04 at \(\Gamma=1\) to 0.18 at \(\Gamma=2\), what does that change say—and not say—about hidden bias?

Solutions. (1) The ranks are 1, 2.5, 2.5, and 4: the tied values of 3 occupy positions 2 and 3. (2) The probability is \(\Gamma/(1+\Gamma)=1/2\). (3) Its signed contribution is zero regardless of assignment, so it supplies no directional information; including it would incorrectly shift the ranks of the nonzero differences. (4) The stronger hidden-bias allowance makes the worst-case evidence less compelling for this test, as its bound is larger. It does not show that hidden bias exists, establish its actual strength, or give the probability that the null hypothesis is true.

Clinical Biostats