Compute stage-wise bounds for a two-stage multiple testing procedure.
fCERStageBound(
wgtmat,
family = NULL,
corr = NULL,
alpha,
alpha1,
info_frac,
nthreads = 0
)Weight matrix for the intersection hypotheses
Family matrix indicating which hypotheses belong to which families. The correlation is known only for hypotheses belonging to the same family. If NULL, all hypotheses are assumed to belong to the same family.
Correlation matrix for the test statistics
Overall significance level
Significance level for the first stage
Information fraction for the first stage
The number of threads to use in simulations (0 means the default RcppParallel behavior).
A list containing:
inthyp: The indicator matrix of the intersection hypotheses.
stg1_coef: The stage 1 coefficient for each intersection
hypothesis.
stg2_coef: The stage 2 coefficient for each intersection
hypothesis.
stg1_bnd: The stage 1 bounds for the elementary hypotheses in
each intersection hypothesis.
stg2_bnd: The stage 2 bounds for the elementary hypotheses in
each intersection hypothesis.
Cyrus Mehta, Ajoy Mukhopadhyay, and Martin Posch. Graph Based, Adaptive, Multiarm, Multiple Endpoint, Two-Stage Designs. Statistics in Medicine. 2025.
initial_weights <- c(0.5, 0.5, 0, 0)
transition_matrix <- matrix(c(0, 0.5, 0.5, 0,
0.5, 0, 0, 0.5,
0, 1, 0, 0,
1, 0, 0, 0),
nrow = 4, byrow = TRUE)
wgtmat <- fwgtmat(initial_weights, transition_matrix)
family <- matrix(c(1, 1, 0, 0,
0, 0, 1, 1),
nrow = 2, byrow = TRUE)
corr <- matrix(c(1, 0.5, NA, NA,
0.5, 1, NA, NA,
NA, NA, 1, 0.5,
NA, NA, 0.5, 1),
nrow = 4, byrow = TRUE)
alpha <- 0.025
alpha1 <- errorSpent(0.5, alpha, "sfOF")
fCERStageBound(wgtmat, family, corr, alpha,
alpha1, info_frac = 0.5, nthreads = 1)
#> $inthyp
#> [,1] [,2] [,3] [,4]
#> [1,] 1 1 1 1
#> [2,] 1 1 1 0
#> [3,] 1 1 0 1
#> [4,] 1 1 0 0
#> [5,] 1 0 1 1
#> [6,] 1 0 1 0
#> [7,] 1 0 0 1
#> [8,] 1 0 0 0
#> [9,] 0 1 1 1
#> [10,] 0 1 1 0
#> [11,] 0 1 0 1
#> [12,] 0 1 0 0
#> [13,] 0 0 1 1
#> [14,] 0 0 1 0
#> [15,] 0 0 0 1
#>
#> $stg1_coef
#> [1] 0.001564065 0.001564065 0.001564065 0.001564065 0.001525323 0.001525323
#> [7] 0.001525323 0.001525323 0.001525323 0.001525323 0.001525323 0.001525323
#> [13] 0.001564065 0.001525323 0.001525323
#>
#> $stg2_coef
#> [1] 0.02636863 0.02636863 0.02636863 0.02636863 0.02440887 0.02449976
#> [7] 0.02440887 0.02449976 0.02440887 0.02440887 0.02449976 0.02449976
#> [13] 0.02636863 0.02449976 0.02449976
#>
#> $stg1_bnd
#> [,1] [,2] [,3] [,4]
#> [1,] 0.0007820325 0.0007820325 0.0000000000 0.0000000000
#> [2,] 0.0007820325 0.0007820325 0.0000000000 0.0000000000
#> [3,] 0.0007820325 0.0007820325 0.0000000000 0.0000000000
#> [4,] 0.0007820325 0.0007820325 0.0000000000 0.0000000000
#> [5,] 0.0011439921 0.0000000000 0.0000000000 0.0003813307
#> [6,] 0.0015253228 0.0000000000 0.0000000000 0.0000000000
#> [7,] 0.0011439921 0.0000000000 0.0000000000 0.0003813307
#> [8,] 0.0015253228 0.0000000000 0.0000000000 0.0000000000
#> [9,] 0.0000000000 0.0011439921 0.0003813307 0.0000000000
#> [10,] 0.0000000000 0.0011439921 0.0003813307 0.0000000000
#> [11,] 0.0000000000 0.0015253228 0.0000000000 0.0000000000
#> [12,] 0.0000000000 0.0015253228 0.0000000000 0.0000000000
#> [13,] 0.0000000000 0.0000000000 0.0007820325 0.0007820325
#> [14,] 0.0000000000 0.0000000000 0.0015253228 0.0000000000
#> [15,] 0.0000000000 0.0000000000 0.0000000000 0.0015253228
#>
#> $stg2_bnd
#> [,1] [,2] [,3] [,4]
#> [1,] 0.01318431 0.01318431 0.000000000 0.000000000
#> [2,] 0.01318431 0.01318431 0.000000000 0.000000000
#> [3,] 0.01318431 0.01318431 0.000000000 0.000000000
#> [4,] 0.01318431 0.01318431 0.000000000 0.000000000
#> [5,] 0.01830665 0.00000000 0.000000000 0.006102218
#> [6,] 0.02449976 0.00000000 0.000000000 0.000000000
#> [7,] 0.01830665 0.00000000 0.000000000 0.006102218
#> [8,] 0.02449976 0.00000000 0.000000000 0.000000000
#> [9,] 0.00000000 0.01830665 0.006102218 0.000000000
#> [10,] 0.00000000 0.01830665 0.006102218 0.000000000
#> [11,] 0.00000000 0.02449976 0.000000000 0.000000000
#> [12,] 0.00000000 0.02449976 0.000000000 0.000000000
#> [13,] 0.00000000 0.00000000 0.013184313 0.013184313
#> [14,] 0.00000000 0.00000000 0.024499763 0.000000000
#> [15,] 0.00000000 0.00000000 0.000000000 0.024499763
#>