Compute conditional error rates for the intersection hypotheses after the first stage of a two-stage multiple testing procedure.
fCERCer(
stg1_p,
wgtmat,
family = NULL,
corr = NULL,
info_frac,
stg1_bnd,
stg2_bnd,
nthreads = 0
)P-values for the elementary hypotheses in stage 1.
Weight matrix for the intersection hypotheses.
Family matrix indicating which hypotheses belong to which families. If NULL, all hypotheses are assumed to belong to the same family.
Correlation matrix for the test statistics.
Information fraction for the first stage.
Stage 1 bounds for the elementary hypotheses in each intersection hypothesis.
Stage 2 bounds for the elementary hypotheses in each intersection hypothesis.
The number of threads to use in simulations (0 means the default RcppParallel behavior).
A list containing:
stg1_elemhyp_r_idx: The 1-based indices of elementary hypotheses
rejected in stage 1.
stg1_inthyp_nr_idx: The 1-based indices of intersection
hypotheses not rejected in stage 1.
inthyp: The indicator matrix of those non-rejected intersection
hypotheses.
CER: The conditional error rate for each non-rejected
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)
bounds <- fCERStageBound(
wgtmat, family, corr, alpha = 0.025,
alpha1 = errorSpent(0.5, 0.025, "sfOF"),
info_frac = 0.5, nthreads = 1)
fCERCer(stg1_p = c(0.00045, 0.0952, 0.0225, 0.1104),
wgtmat, family, corr, info_frac = 0.5,
bounds$stg1_bnd, bounds$stg2_bnd, nthreads = 1)
#> $stg1_elemhyp_r_idx
#> [1] 1
#>
#> $stg1_inthyp_nr_idx
#> [1] 9 10 11 12 13 14 15
#>
#> $inthyp
#> [,1] [,2] [,3] [,4]
#> [1,] 0 1 1 1
#> [2,] 0 1 1 0
#> [3,] 0 1 0 1
#> [4,] 0 1 0 0
#> [5,] 0 0 1 1
#> [6,] 0 0 1 0
#> [7,] 0 0 0 1
#>
#> $CER
#> [1] 0.11166977 0.11166977 0.07015762 0.07015762 0.14167454 0.21788372 0.05942589
#>