infRates <- seq(0.1, 0.9, 0.05)
power <- Vectorize(function(x) {
getDesignGroupSequential(
directionUpper = FALSE,
alpha = 0.025,
typeOfDesign = "asHSD",
gammaA = -4.5,
informationRates = c(x, 1)
) |>
getPowerSurvival(
hazardRatio = 0.563,
pi2 = 0.37,
eventTime = 6,
maxNumberOfEvents = 110,
maxNumberOfSubjects = 262,
accrualTime = 24
) |> fetch(overallReject)
})
ggplot(data.frame(infRates = infRates, power = power(infRates)),
aes(infRates, power)
) +
geom_line() + ylim(0.83, 0.87) +
geom_hline(yintercept = 0.85, linetype = 2, lwd = 0.5, color = "red") +
ggtitle("Overall Power") +
theme_classic() + grids(linetype = "dashed") +
theme(plot.title=element_text(face='bold', size=16))







