Skip to contents

An intersection hypothesis can be rejected if its p-values are less than or equal to their adjusted significance levels, which are their adjusted hypothesis weights times \(\alpha\). For Bonferroni tests, their adjusted hypothesis weights are their hypothesis weights of the intersection hypothesis. Additional adjustment is needed for parametric and Simes tests:

  • Parametric tests for adjust_weights_parametric(),

    • Note that one-sided tests are required for parametric tests.

  • Simes tests for adjust_weights_simes().

Usage

adjust_weights_parametric(
  matrix_weights,
  matrix_intersections,
  test_corr,
  alpha,
  test_groups,
  maxpts = 25000,
  abseps = 1e-06,
  releps = 0
)

adjust_weights_simes(matrix_weights, p, test_groups)

Arguments

matrix_weights

(Optional) A matrix of hypothesis weights of all intersection hypotheses. This can be obtained as the second half of columns from the output of graph_generate_weights().

matrix_intersections

(Optional) A matrix of hypothesis indicators of all intersection hypotheses. This can be obtained as the first half of columns from the output of graph_generate_weights().

test_corr

(Optional) A numeric matrix of correlations between test statistics, which is needed to perform parametric tests using adjust_weights_parametric(). The number of rows and columns of this correlation matrix should match the length of p.

alpha

(Optional) A numeric value of the overall significance level, which should be between 0 & 1. The default is 0.025 for one-sided hypothesis testing problems; another common choice is 0.05 for two-sided hypothesis testing problems. Note when parametric tests are used, only one-sided tests are supported.

test_groups

(Optional) A list of numeric vectors specifying hypotheses to test together. Grouping is needed to correctly perform Simes and parametric tests.

maxpts

(Optional) An integer scalar for the maximum number of function values, which is needed to perform parametric tests using the mvtnorm::GenzBretz algorithm. The default is 25000.

abseps

(Optional) A numeric scalar for the absolute error tolerance, which is needed to perform parametric tests using the mvtnorm::GenzBretz algorithm. The default is 1e-6.

releps

(Optional) A numeric scalar for the relative error tolerance as double, which is needed to perform parametric tests using the mvtnorm::GenzBretz algorithm. The default is 0.

p

(Optional) A numeric vector of p-values (unadjusted, raw), whose values should be between 0 & 1. The length should match the number of columns of matrix_weights.

Value

  • adjust_weights_parametric() returns a matrix with the same dimensions as matrix_weights, whose hypothesis weights have been adjusted according to parametric tests.

  • adjust_weights_simes() returns a matrix with the same dimensions as matrix_weights, whose hypothesis weights have been adjusted according to Simes tests.

References

Lu, K. (2016). Graphical approaches using a Bonferroni mixture of weighted Simes tests. Statistics in Medicine, 35(22), 4041-4055.

Xi, D., Glimm, E., Maurer, W., and Bretz, F. (2017). A unified framework for weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.

See also

adjust_p_parametric() for adjusted p-values using parametric tests, adjust_p_simes() for adjusted p-values using Simes tests.

Examples

alpha <- 0.025
p <- c(0.018, 0.01, 0.105, 0.006)
num_hyps <- length(p)
g <- bonferroni_holm(rep(1 / 4, 4))
weighting_strategy <- graph_generate_weights(g)
matrix_intersections <- weighting_strategy[, seq_len(num_hyps)]
matrix_weights <- weighting_strategy[, -seq_len(num_hyps)]

set.seed(1234)
adjust_weights_parametric(
  matrix_weights = matrix_weights,
  matrix_intersections = matrix_intersections,
  test_corr = diag(4),
  alpha = alpha,
  test_groups = list(1:4)
)
#>           H1        H2        H3        H4
#> 1  0.2523785 0.2523785 0.2523785 0.2523785
#> 2  0.3361503 0.3361503 0.3361503 0.0000000
#> 3  0.3361503 0.3361503 0.0000000 0.3361503
#> 4  0.5031647 0.5031647 0.0000000 0.0000000
#> 5  0.3361503 0.0000000 0.3361503 0.3361503
#> 6  0.5031647 0.0000000 0.5031647 0.0000000
#> 7  0.5031647 0.0000000 0.0000000 0.5031647
#> 8  1.0000000 0.0000000 0.0000000 0.0000000
#> 9  0.0000000 0.3361503 0.3361503 0.3361503
#> 10 0.0000000 0.5031647 0.5031647 0.0000000
#> 11 0.0000000 0.5031647 0.0000000 0.5031647
#> 12 0.0000000 1.0000000 0.0000000 0.0000000
#> 13 0.0000000 0.0000000 0.5031647 0.5031647
#> 14 0.0000000 0.0000000 1.0000000 0.0000000
#> 15 0.0000000 0.0000000 0.0000000 1.0000000
alpha <- 0.025
p <- c(0.018, 0.01, 0.105, 0.006)
num_hyps <- length(p)
g <- bonferroni_holm(rep(1 / 4, 4))
weighting_strategy <- graph_generate_weights(g)
matrix_intersections <- weighting_strategy[, seq_len(num_hyps)]
matrix_weights <- weighting_strategy[, -seq_len(num_hyps)]

adjust_weights_simes(
  matrix_weights = matrix_weights,
  p = p,
  test_groups = list(1:4)
)
#>           H4        H2        H1 H3
#> 1  0.2500000 0.5000000 0.7500000  1
#> 2  0.0000000 0.3333333 0.6666667  1
#> 3  0.3333333 0.6666667 1.0000000  1
#> 4  0.0000000 0.5000000 1.0000000  1
#> 5  0.3333333 0.3333333 0.6666667  1
#> 6  0.0000000 0.0000000 0.5000000  1
#> 7  0.5000000 0.5000000 1.0000000  1
#> 8  0.0000000 0.0000000 1.0000000  1
#> 9  0.3333333 0.6666667 0.6666667  1
#> 10 0.0000000 0.5000000 0.5000000  1
#> 11 0.5000000 1.0000000 1.0000000  1
#> 12 0.0000000 1.0000000 1.0000000  1
#> 13 0.5000000 0.5000000 0.5000000  1
#> 14 0.0000000 0.0000000 0.0000000  1
#> 15 1.0000000 1.0000000 1.0000000  1