diff --git a/R/gs_design_ahr.R b/R/gs_design_ahr.R index 071df325..75095726 100644 --- a/R/gs_design_ahr.R +++ b/R/gs_design_ahr.R @@ -236,6 +236,9 @@ gs_design_ahr <- function( if ((length(analysis_time) > 1) && (length(info_frac) > 1) && (length(info_frac) != length(analysis_time))) { stop("gs_design_ahr() info_frac and analysis_time must have the same length if both have length > 1.") } + if(all(fail_rate$hr == 1)){ + stop("gs_design_ahr() hr must not be equal to 1 throughout the study as this is the null hypothesis.") + } # --------------------------------------------- # # check if alpha is same as alpha spending # diff --git a/R/gs_design_combo.R b/R/gs_design_combo.R index f86e7260..0d831986 100644 --- a/R/gs_design_combo.R +++ b/R/gs_design_combo.R @@ -178,6 +178,10 @@ gs_design_combo <- function( two_sided <- TRUE } + if(all(fail_rate$hr == 1)){ + stop("gs_design_combo() hr must not be equal to 1 throughout the study as this is the null hypothesis.") + } + # Information Fraction if (n_analysis == 1) { min_info_frac <- 1 diff --git a/R/gs_design_wlr.R b/R/gs_design_wlr.R index 48d74245..916b3b30 100644 --- a/R/gs_design_wlr.R +++ b/R/gs_design_wlr.R @@ -152,6 +152,9 @@ gs_design_wlr <- function( if (max(info_frac) != 1) stop(msg) msg <- "gs_design_wlr(): info_frac and analysis_time must have the same length if both have length > 1" if ((length(analysis_time) > 1) && (length(info_frac) > 1) && (length(info_frac) != length(analysis_time))) stop(msg) + if(all(fail_rate$hr == 1)){ + stop("gs_design_wlr() hr must not be equal to 1 throughout the study as this is the null hypothesis.") + } # get the info_scale info_scale <- match.arg(info_scale)