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)
Run the code above in your browser using DataLab