diff --git a/R/gs_cp.R b/R/gs_cp.R index cf60c1df3..9e303c56b 100644 --- a/R/gs_cp.R +++ b/R/gs_cp.R @@ -76,11 +76,17 @@ #' info_scale = "h0_h1_info") |> to_integer() #' #' # calculate conditional power -#' # case 1: currently at IA1, compute conditional power at IA2, IA3 and FA, with default theta = NULL -#' gs_cp(x = x, i = 1, zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) +#' # case 1: currently at IA1, compute conditional power at IA2, IA3 and FA, +#' # with default theta = NULL +#' gs_cp(x = x, i = 1, +#' zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) #' -#' # case 2: currently at IA1, compute conditional power at IA2, IA3 and FA, with user-input theta -#' gs_cp(x = x, theta = c(0.15, 0.2, 0.25, 0.3), i = 1, zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) +#' # case 2: currently at IA1, compute conditional power at IA2, IA3 and FA, +#' # with user-input theta +#' gs_cp(x = x, +#' theta = c(0.15, 0.2, 0.25, 0.3), +#' i = 1, +#' zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) #' gs_cp <- function(x = NULL, theta = NULL, i = 1, zi = NULL){ # ------------------------------ # diff --git a/R/gs_cp_simple.R b/R/gs_cp_simple.R index 46e11c488..1a97176e4 100644 --- a/R/gs_cp_simple.R +++ b/R/gs_cp_simple.R @@ -43,7 +43,8 @@ #' @examples #' library(gsDesign2) #' library(gsDesign) -#' # Calculate conditional power with optional user-input theta (if NULL, will come from the input design) +#' # Calculate conditional power with optional user-input theta +#' # (if NULL, will come from the input design) #' alpha <- 0.025 #' beta <- 0.1 #' ratio <- 1 diff --git a/man/gs_cp.Rd b/man/gs_cp.Rd index a86b18b37..e83471988 100644 --- a/man/gs_cp.Rd +++ b/man/gs_cp.Rd @@ -70,10 +70,16 @@ x <- gs_design_ahr(enroll_rate = enroll_rate, fail_rate = fail_rate, info_scale = "h0_h1_info") |> to_integer() # calculate conditional power -# case 1: currently at IA1, compute conditional power at IA2, IA3 and FA, with default theta = NULL -gs_cp(x = x, i = 1, zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) +# case 1: currently at IA1, compute conditional power at IA2, IA3 and FA, +# with default theta = NULL +gs_cp(x = x, i = 1, +zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) -# case 2: currently at IA1, compute conditional power at IA2, IA3 and FA, with user-input theta -gs_cp(x = x, theta = c(0.15, 0.2, 0.25, 0.3), i = 1, zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) +# case 2: currently at IA1, compute conditional power at IA2, IA3 and FA, +# with user-input theta +gs_cp(x = x, + theta = c(0.15, 0.2, 0.25, 0.3), + i = 1, + zi = -gsDesign::hrn2z(hr = 0.8, n = 150+180, ratio = 1)) } diff --git a/man/gs_cp_simple.Rd b/man/gs_cp_simple.Rd index efb615e90..9143303ad 100644 --- a/man/gs_cp_simple.Rd +++ b/man/gs_cp_simple.Rd @@ -39,7 +39,8 @@ and \eqn{\theta_i} is the natural parameter for treatment effect at analysis \eq \examples{ library(gsDesign2) library(gsDesign) -# Calculate conditional power with optional user-input theta (if NULL, will come from the input design) +# Calculate conditional power with optional user-input theta +# (if NULL, will come from the input design) alpha <- 0.025 beta <- 0.1 ratio <- 1