safety_design <- binomialSPRT(p0 = .04, p1 = .1, alpha = .04, beta = .2, minn = 4, maxn = 75)
safety_power <- gsBinomialExact(
k = length(safety_design$n.I),
theta = seq(.02, .16, .02),
n.I = safety_design$n.I,
a = safety_design$lower$bound,
b = safety_design$upper$bound
)
safety_power %>%
as_table() %>%
as_gt(
theta_label = gt::html("UnderlyingAE rate"),
prob_decimals = 3,
bound_label = c("low rate", "high rate")
)
Run the code above in your browser using DataLab