Skip to content

Commit 8c7afc1

Browse files
authoredNov 8, 2024··
Merge pull request #479 from Merck/478-use-info-of-wlr-when-it-is-an-integer-wlr-design
Add info of WLR to `to_integer()`
2 parents b93e91f + 4e16705 commit 8c7afc1

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed
 

‎R/to_integer.R

+18-7
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,24 @@ to_integer.gs_design <- function(x, sample_size = TRUE, round_up_final = TRUE, .
315315
} else if (identical(x$input$upper, gs_spending_bound)) {
316316
upar_new <- x$input$upar
317317
if (!("timing" %in% names(x$input$upar))) {
318-
info_with_new_event <- gs_info_ahr(
319-
enroll_rate = enroll_rate_new,
320-
fail_rate = x$input$fail_rate,
321-
ratio = x$input$ratio,
322-
event = event_new,
323-
analysis_time = NULL
324-
)
318+
if (is_ahr) {
319+
info_with_new_event <- gs_info_ahr(
320+
enroll_rate = enroll_rate_new,
321+
fail_rate = x$input$fail_rate,
322+
ratio = x$input$ratio,
323+
event = event_new,
324+
analysis_time = NULL
325+
)
326+
} else if (is_wlr) {
327+
info_with_new_event <- gs_info_wlr(
328+
enroll_rate = enroll_rate_new,
329+
fail_rate = x$input$fail_rate,
330+
ratio = x$input$ratio,
331+
event = event_new,
332+
analysis_time = NULL,
333+
weight = x$input$weight
334+
)
335+
}
325336

326337
# ensure info0 is based on integer sample size calculation
327338
# as as they become a slight different number due to the `enroll_rate`

0 commit comments

Comments
 (0)
Please sign in to comment.