Skip to content

Commit 7eb9ef3

Browse files
committed
update to_integer for info0 and info when both sample size and events are integers
1 parent d2eb2f1 commit 7eb9ef3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

R/to_integer.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,19 @@ to_integer.gs_design <- function(x, sample_size = TRUE, ...) {
308308
analysis_time = NULL
309309
)
310310

311-
upar_new$timing <- info_with_new_event$info / max(info_with_new_event$info)
311+
# ensure info0 is based on integer sample size calculation
312+
# as as they become a slight different number due to the `enroll_rate`
313+
q_e <- x$input$ratio / (1 + x$input$ratio)
314+
q_c <- 1 - q_e
315+
info_with_new_event$info0 <- event_new * q_e * q_c
316+
317+
# ensure info is based on integer sample size calculation
318+
# as as they become a slight different number due to the `enroll_rate`
319+
q <- event_new / event
320+
info_with_new_event$info <- x$analysis$info * q
321+
322+
# update timing
323+
upar_new$timing <- info_with_new_event$info0 / max(info_with_new_event$info0)
312324
}
313325
}
314326

0 commit comments

Comments
 (0)