Compute local p-values for the intersection hypotheses in a two-stage adaptive multiple testing procedure using a p-value combination method.
fPCStagewise(
stg2_p,
wgtmat = NULL,
family = NULL,
corr = NULL,
stg1_inthyp_nr_idx,
stg2_elemhyp_idx,
stg2_wgtmat = NULL,
test = "dunnett",
nthreads = 0
)Stage 2 p-values for the elementary hypotheses.
Weight matrix for the stage 1 intersection hypotheses. If
NULL, equal weights are assigned within each intersection
hypothesis.
Family matrix indicating which hypotheses belong to which families. The correlation is known only for hypotheses belonging to the same family. Defaults to one family containing all elementary hypotheses.
Correlation matrix for the test statistics. If NULL,
within-family correlations are 0.5 and between-family correlations are
missing.
Indices of the stage 1 intersection hypotheses that were not rejected.
Indices of the elementary hypotheses tested at stage 2.
Weight matrix for the stage 2 intersection hypotheses.
If NULL, equal weights are assigned within each intersection
hypothesis.
P-value combination method. It can start with "bon",
"sim", or "dun"; the default is "dunnett".
The number of threads to use in simulations (0 means the default RcppParallel behavior).
A list containing:
inthyp_idx: The 1-based indices of the stage 1 intersection
hypotheses represented in the output.
inthyp: Their intersection-hypothesis indicator matrix.
pinter: Their local p-values.
Despite the stage-oriented parameter names, this function can also be used
to generate stage 1 local p-values. In that case, provide the complete set
of intersection hypotheses in stg1_inthyp_nr_idx, all elementary
hypotheses in stg2_elemhyp_idx, and the corresponding stage 1 p-values
and weight matrix. The example illustrates this use.
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)
fPCStagewise(stg2_p = c(0.00045, 0.0952, 0.0225, 0.1104),
wgtmat = wgtmat, family = family, corr = corr,
stg1_inthyp_nr_idx = 1:15, stg2_elemhyp_idx = 1:4,
stg2_wgtmat = wgtmat, test = "dunnett",
nthreads = 1)
#> $inthyp_idx
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#>
#> $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
#>
#> $pinter
#> [1] 0.0008818226 0.0008818226 0.0008818226 0.0008818226 0.0006000000
#> [6] 0.0004500000 0.0006000000 0.0004500000 0.0900000000 0.0900000000
#> [11] 0.0952000000 0.0952000000 0.0410090025 0.0225000000 0.1104000000
#>