Skip to contents

Computes bounds on the p-value for the treatment effect over a grid of values of gamma (the maximum odds ratio of differential treatment assignment due to an unobserved confounder). Uses the Wilcoxon signed-rank approach. For exact bounds, see sensitivitymv::senmv or the rbounds package.

Usage

morie_matching_rosenbaum_bounds(
  data,
  outcome,
  treatment,
  match_pairs,
  gamma_range = NULL
)

Arguments

data

Data frame.

outcome, treatment

Column names.

match_pairs

Data frame of matched indices.

gamma_range

Optional numeric vector of \(\Gamma\) values.

Value

A data frame with columns gamma, p_lower, p_upper, significant_lower, significant_upper.

References

Rosenbaum, P. R. (2002). Observational Studies (2nd ed.). Springer.

Examples

# \donttest{
set.seed(1)
df <- data.frame(y = rnorm(200), d = rbinom(200, 1, 0.4),
                 x1 = rnorm(200), x2 = rnorm(200))
res <- morie_matching_nearest_neighbor(df, "d", c("x1", "x2"))
morie_matching_rosenbaum_bounds(df, "y", "d", res$match_pairs)
#>   gamma      p_lower   p_upper significant_lower significant_upper
#> 1  1.00 4.067942e-01 0.4067942             FALSE             FALSE
#> 2  1.10 6.715873e-01 0.8881371             FALSE             FALSE
#> 3  1.20 5.372467e-01 0.9420822             FALSE             FALSE
#> 4  1.30 4.094214e-01 0.9714423             FALSE             FALSE
#> 5  1.50 2.098582e-01 0.9937942             FALSE             FALSE
#> 6  1.75 7.576834e-02 0.9992073             FALSE             FALSE
#> 7  2.00 2.361710e-02 0.9999094              TRUE             FALSE
#> 8  2.50 1.725594e-03 0.9999990              TRUE             FALSE
#> 9  3.00 9.996084e-05 1.0000000              TRUE             FALSE
# }