zz <- gsBinomialExact(
k = 3, theta = seq(0.1, 0.9, 0.1), n.I = c(12, 24, 36),
a = c(-1, 0, 11), b = c(5, 9, 12)
)
zz %>%
as_table() %>%
as_rtf(
file = tempfile(fileext = ".rtf"),
title = "Power/Type I Error and Expected Sample Size for a Group Sequential Design"
)
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_rtf(
file = tempfile(fileext = ".rtf"),
theta_label = "Underlying\nAE Rate",
prob_decimals = 3,
bound_label = c("Low Rate", "High Rate")
)
Run the code above in your browser using DataLab