@@ -250,14 +250,32 @@ test_that("Validate the sample size rounding under unequal randomization (3:2) f
250
250
})
251
251
252
252
test_that(" Validate the boundary is symmetric in symmetric designs." , {
253
- x <- gs_design_ahr(analysis_time = 36 , info_frac = 1 : 3 / 3 ,
253
+ x <- gs_design_ahr(analysis_time = 36 , info_frac = 1 : 3 / 3 ,
254
254
upper = gs_spending_bound ,
255
255
upar = list (sf = gsDesign :: sfLDOF , total_spend = 0.025 ),
256
256
lower = gs_spending_bound ,
257
257
lpar = list (sf = gsDesign :: sfLDOF , total_spend = 0.025 ),
258
258
binding = TRUE , h1_spending = FALSE ) %> %
259
259
to_integer()
260
-
261
- expect_equal(x $ bound $ z [x $ bound $ bound == " upper" ],
260
+
261
+ expect_equal(x $ bound $ z [x $ bound $ bound == " upper" ],
262
262
- x $ bound $ z [x $ bound $ bound == " lower" ])
263
263
})
264
+
265
+ test_that(" verify the crossing prob of a MB design at IA1 under null" , {
266
+ x <- gs_power_wlr(enroll_rate = define_enroll_rate(duration = 12 , rate = 35.8 ),
267
+ fail_rate = define_fail_rate(duration = c(4 , 100 ),
268
+ fail_rate = log(2 )/ 12 ,
269
+ dropout_rate = 0.001 ,
270
+ hr = c(1 , 0.6 )),
271
+ analysis_time = c(20 , 28 , 36 ),
272
+ weight = list (method = " mb" , param = list (tau = NULL , w_max = 2 )),
273
+ upper = gs_spending_bound ,
274
+ upar = list (sf = gsDesign :: sfLDOF , total_spend = 0.025 ),
275
+ lpar = rep(- Inf , 3 ),
276
+ lower = gs_b ,
277
+ test_lower = FALSE ) | > to_integer()
278
+
279
+ expect_equal((x $ bounds | > filter(bound == " upper" , analysis == 1 ))$ probability0 ,
280
+ sfLDOF(alpha = .025 , t = x $ analysis $ info_frac0 )$ spend [1 ])
281
+ })
0 commit comments