View source: R/adaptive_two_stage.R
| fCERNewBound | R Documentation |
Compute new stage 2 bounds after an adaptation of the hypotheses tested or their weights.
fCERNewBound(
stg1_p,
wgtmat,
family = NULL,
corr = NULL,
stg1_inthyp_nr_idx,
CER,
stg2_elemhyp_idx,
stg2_wgtmat,
info_frac_new,
nthreads = 0
)
stg1_p |
P-values for the elementary hypotheses in stage 1. |
wgtmat |
Weight matrix for the original intersection hypotheses. |
family |
Family matrix indicating which hypotheses belong to which families. If NULL, all hypotheses are assumed to belong to the same family. |
corr |
Correlation matrix for the test statistics. |
stg1_inthyp_nr_idx |
Indices of the intersection hypotheses not rejected in stage 1. |
CER |
Conditional error rates for the intersection hypotheses. |
stg2_elemhyp_idx |
Indices of the elementary hypotheses in stage 2. |
stg2_wgtmat |
Weight matrix for the intersection hypotheses in stage 2. |
info_frac_new |
New information fraction for stage 1 after adaptation. |
nthreads |
The number of threads to use in simulations (0 means the default RcppParallel behavior). |
A list containing:
inthyp: The indicator matrix of the adapted intersection
hypotheses.
stg2_coef_new: The new stage 2 coefficient for each adapted
intersection hypothesis.
stg2_bnd_new: The new stage 2 bounds for the elementary hypotheses
in each adapted intersection hypothesis.
Kaifeng Lu, kaifenglu@gmail.com
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)
stage1_pvalues <- c(0.00045, 0.0952, 0.0225, 0.1104)
bounds <- fCERStageBound(
wgtmat, family, corr, alpha = 0.025,
alpha1 = errorSpent(0.5, 0.025, "sfOF"),
info_frac = 0.5, nthreads = 1)
conditional_error_rates <- fCERCer(
stage1_pvalues, wgtmat, family, corr, info_frac = 0.5,
bounds$stg1_bnd, bounds$stg2_bnd, nthreads = 1)
stage2_weight_matrix <- fwgtmat(
w = c(0.5, 0.5),
G = matrix(c(0, 1, 1, 0), 2, 2, byrow = TRUE))
fCERNewBound(stage1_pvalues, wgtmat, family, corr,
conditional_error_rates$stg1_inthyp_nr_idx,
conditional_error_rates$CER,
stg2_elemhyp_idx = c(2, 4),
stage2_weight_matrix, info_frac_new = 0.4,
nthreads = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.