|
80 | 80 | #' ) |
81 | 81 | #' } |
82 | 82 | calc_seq_p <- function( |
83 | | - test_analysis = 2, |
84 | | - test_hypothesis = "H1, H2, H3", |
85 | | - p_obs = tibble::tibble( |
86 | | - analysis = 1:2, |
87 | | - H1 = c(0.02, 0.0015), |
88 | | - H2 = c(0.01, 0.01), |
89 | | - H3 = c(0.01, 0.004) |
| 83 | + test_analysis = 2, |
| 84 | + test_hypothesis = "H1, H2, H3", |
| 85 | + p_obs = tibble::tibble( |
| 86 | + analysis = 1:2, |
| 87 | + H1 = c(0.02, 0.0015), |
| 88 | + H2 = c(0.01, 0.01), |
| 89 | + H3 = c(0.01, 0.004) |
| 90 | + ), |
| 91 | + alpha_spending_type = 2, |
| 92 | + n_analysis = 2, |
| 93 | + initial_weight = c(0.3, 0.3, 0.4), |
| 94 | + transition_mat = matrix(c( |
| 95 | + 0.0000000, 0.4285714, 0.5714286, |
| 96 | + 0.4285714, 0.0000000, 0.5714286, |
| 97 | + 0.5000000, 0.5000000, 0.0000000 |
| 98 | + ), nrow = 3, byrow = TRUE), |
| 99 | + z_corr = matrix( |
| 100 | + c( |
| 101 | + 1.0000000, 0.7627701, 0.6666667, 0.7071068, 0.5393599, 0.4714045, |
| 102 | + 0.7627701, 1.0000000, 0.6992059, 0.5393599, 0.7071068, 0.4944132, |
| 103 | + 0.6666667, 0.6992059, 1.0000000, 0.4714045, 0.4944132, 0.7071068, |
| 104 | + 0.7071068, 0.5393599, 0.4714045, 1.0000000, 0.7627701, 0.6666667, |
| 105 | + 0.5393599, 0.7071068, 0.4944132, 0.7627701, 1.0000000, 0.6992059, |
| 106 | + 0.4714045, 0.4944132, 0.7071068, 0.6666667, 0.6992059, 1.0000000 |
90 | 107 | ), |
91 | | - alpha_spending_type = 2, |
92 | | - n_analysis = 2, |
93 | | - initial_weight = c(0.3, 0.3, 0.4), |
94 | | - transition_mat = matrix(c( |
95 | | - 0.0000000, 0.4285714, 0.5714286, |
96 | | - 0.4285714, 0.0000000, 0.5714286, |
97 | | - 0.5000000, 0.5000000, 0.0000000 |
98 | | - ), nrow = 3, byrow = TRUE), |
99 | | - z_corr = matrix( |
100 | | - c( |
101 | | - 1.0000000, 0.7627701, 0.6666667, 0.7071068, 0.5393599, 0.4714045, |
102 | | - 0.7627701, 1.0000000, 0.6992059, 0.5393599, 0.7071068, 0.4944132, |
103 | | - 0.6666667, 0.6992059, 1.0000000, 0.4714045, 0.4944132, 0.7071068, |
104 | | - 0.7071068, 0.5393599, 0.4714045, 1.0000000, 0.7627701, 0.6666667, |
105 | | - 0.5393599, 0.7071068, 0.4944132, 0.7627701, 1.0000000, 0.6992059, |
106 | | - 0.4714045, 0.4944132, 0.7071068, 0.6666667, 0.6992059, 1.0000000 |
107 | | - ), |
108 | | - nrow = 6, byrow = TRUE |
109 | | - ), |
110 | | - spending_fun = gsDesign::sfHSD, |
111 | | - spending_fun_par = -4, |
112 | | - info_frac = c(0.5, 1), |
113 | | - interval = c(1e-4, 0.2)) { |
| 108 | + nrow = 6, byrow = TRUE |
| 109 | + ), |
| 110 | + spending_fun = gsDesign::sfHSD, |
| 111 | + spending_fun_par = -4, |
| 112 | + info_frac = c(0.5, 1), |
| 113 | + interval = c(1e-4, 0.2) |
| 114 | +) { |
114 | 115 | foo <- function(x) { |
115 | 116 | all_hypothesis <- strsplit(test_hypothesis, split = ", ") %>% unlist() |
116 | 117 | all_hypothesis_idx <- as.numeric(gsub(".*?([0-9]+).*", "\\1", all_hypothesis)) |
|
0 commit comments