Skip to content

Commit

Permalink
Merge pull request #479 from Merck/478-use-info-of-wlr-when-it-is-an-…
Browse files Browse the repository at this point in the history
…integer-wlr-design

Add info of WLR to `to_integer()`
  • Loading branch information
LittleBeannie authored Nov 8, 2024
2 parents b93e91f + 4e16705 commit 8c7afc1
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions R/to_integer.R
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,24 @@ to_integer.gs_design <- function(x, sample_size = TRUE, round_up_final = TRUE, .
} else if (identical(x$input$upper, gs_spending_bound)) {
upar_new <- x$input$upar
if (!("timing" %in% names(x$input$upar))) {
info_with_new_event <- gs_info_ahr(
enroll_rate = enroll_rate_new,
fail_rate = x$input$fail_rate,
ratio = x$input$ratio,
event = event_new,
analysis_time = NULL
)
if (is_ahr) {
info_with_new_event <- gs_info_ahr(
enroll_rate = enroll_rate_new,
fail_rate = x$input$fail_rate,
ratio = x$input$ratio,
event = event_new,
analysis_time = NULL
)
} else if (is_wlr) {
info_with_new_event <- gs_info_wlr(
enroll_rate = enroll_rate_new,
fail_rate = x$input$fail_rate,
ratio = x$input$ratio,
event = event_new,
analysis_time = NULL,
weight = x$input$weight
)
}

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

0 comments on commit 8c7afc1

Please sign in to comment.