@@ -61,21 +61,24 @@ test_that("Validate the function based on examples with individual functions",{
61
61
62
62
evt01 <- gsdmvn ::: prob_event.arm(arm0 , tmax = analysisTimes ) * n0 +
63
63
gsdmvn ::: prob_event.arm(arm1 , tmax = analysisTimes ) * n1
64
- log_ahr <- sapply(analysisTimes , function (t_k ) {
65
- gsdmvn ::: gs_delta_wlr(arm0 , arm1 , tmax = t_k , weight = weight ) /
66
- gsdmvn ::: gs_delta_wlr(
67
- arm0 , arm1 ,
68
- tmax = t_k ,
69
- weight = weight ,
70
- approx = " generalized schoenfeld" ,
71
- normalization = TRUE
72
- )
73
- })
64
+ # log_ahr <- sapply(analysisTimes, function(t_k) {
65
+ # gsdmvn:::gs_delta_wlr(arm0, arm1, tmax = t_k, weight = weight) /
66
+ # gsdmvn:::gs_delta_wlr(
67
+ # arm0, arm1,
68
+ # tmax = t_k,
69
+ # weight = weight,
70
+ # approx = "generalized schoenfeld",
71
+ # normalization = TRUE
72
+ # )
73
+ # })
74
+
75
+ avehr <- gsDesign2 :: AHR(enrollRates = enrollRates , failRates = failRates , ratio = ratio ,
76
+ totalDuration = analysisTimes )
74
77
75
78
# FH(0,1)
76
79
expect_equal(object = as.numeric(fh01 $ N ), expected = rep(N01 ,3 ), tolerance = 1 )
77
80
expect_equal(object = as.numeric(fh01 $ Events ), expected = evt01 , tolerance = 1 )
78
- # expect_equal(object = as.numeric(fh01$AHR), expected = exp(log_ahr), tolerance = .025)
81
+ # expect_equal(object = as.numeric(fh01$AHR), expected = exp(log_ahr), tolerance = .025)
79
82
expect_equal(object = as.numeric(fh01 $ delta ), expected = - delta01 , tolerance = .01 )
80
83
expect_equal(object = as.numeric(fh01 $ sigma2 ), expected = sigma201 , tolerance = .01 )
81
84
expect_equal(object = as.numeric(fh01 $ theta ), expected = theta01 , tolerance = .2 )
0 commit comments