We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gs_power_ahr
info0
info
1 parent 65356f8 commit 7c8e218Copy full SHA for 7c8e218
R/gs_power_ahr.R
@@ -197,6 +197,20 @@ gs_power_ahr <- function(
197
interval = interval
198
)
199
200
+ # if both events and sample size are integers, then elaborate the info and info0
201
+ sample_size <- sum(enroll_rate$duration * enroll_rate$rate)
202
+ if (abs(sample_size - round(sample_size)) < 1e-5 && all(abs(event - round(event)) < 1e-5)) {
203
+
204
+ # elaborate info0
205
+ q_e <- ratio / (1 + ratio)
206
+ q_c <- 1 - q_e
207
+ x$info0 <- event * q_e * q_c
208
209
+ # elaborate info
210
+ q <- event / x$event
211
+ x$info <- x$info * q
212
+ }
213
214
# Given the above statistical information, calculate the power ----
215
y_h1 <- gs_power_npe(
216
theta = x$theta,
0 commit comments