Skip to contents

For each sensitivity parameter Gamma (the largest factor by which two units matched on covariates may differ in their odds of treatment), the null distribution of the Wilcoxon signed-rank statistic is bracketed by two extreme distributions in which each pair contributes its rank with probability \(p_+ = \Gamma/(1+\Gamma)\) (upper) or \(p_- = 1/(1+\Gamma)\) (lower). This routine tabulates the per-Gamma p-value intervals by calling CnsRos – the single-Gamma machinery already verified against stats::wilcox.test at Gamma = 1 – which is how Rosenbaum presents the analysis. gamma_critical is the largest grid value whose upper p-value still falls below alpha (NULL if already insensitive at the smallest Gamma).

Usage

Rosenb(matched_pairs, Gamma_grid = c(1, 1.5, 2, 3), alpha = 0.05)

Arguments

matched_pairs

Within-pair differences (treated minus control); exact zeros are dropped.

Gamma_grid

Numeric vector of sensitivity parameters, each at least 1.

alpha

Level used to report gamma_critical.

Value

List with Gamma, p_upper, p_lower (parallel vectors), gamma_critical, n_pairs, W, alpha, method.

References

Rosenbaum, P. R. (2002), Observational Studies, 2nd ed., Springer, Section 4.3 and the Gamma-table presentation of Chapter 4. Single-Gamma engine: CnsRos.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Rosenb(V)
#> $Gamma
#> [1] 1.0 1.5 2.0 3.0
#> 
#> $p_upper
#> [1] 0.005859343 0.019795882 0.037352967 0.072805048
#> 
#> $p_lower
#> [1] 5.859343e-03 1.011025e-03 1.822536e-04 6.337518e-06
#> 
#> $gamma_critical
#> [1] 2
#> 
#> $n_pairs
#> [1] 8
#> 
#> $W
#> [1] 36
#> 
#> $alpha
#> [1] 0.05
#> 
#> $method
#> [1] "Rosenbaum signed-rank sensitivity bounds over Gamma"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"