diff --git a/DESCRIPTION b/DESCRIPTION index bbdbb8f5..e9504a70 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: gsDesign2 Title: Group Sequential Design with Non-Constant Effect -Version: 1.1.2.20 +Version: 1.1.2.21 Authors@R: c( person("Keaven", "Anderson", email = "keaven_anderson@merck.com", role = c("aut")), person("Yilong", "Zhang", email = "elong0527@gmail.com", role = c("aut")), diff --git a/R/fixed_design_mb.R b/R/fixed_design_mb.R index db90d001..9c27bf0f 100644 --- a/R/fixed_design_mb.R +++ b/R/fixed_design_mb.R @@ -23,7 +23,7 @@ #' @param ratio Experimental:Control randomization ratio. #' @param study_duration Study duration. #' @param tau Test parameter of Magirr-Burman method. -#' +#' @param w_max Test parameter of Magirr-Burman method. #' @export #' #' @rdname fixed_design @@ -43,7 +43,8 @@ #' dropout_rate = .001 #' ), #' study_duration = 36, -#' tau = 4 +#' tau = 4, +#' w_max = 2 #' ) #' x %>% summary() #' @@ -58,7 +59,8 @@ #' dropout_rate = .001 #' ), #' study_duration = 36, -#' tau = 4 +#' tau = 4, +#' w_max = 2 #' ) #' x %>% summary() #' @@ -69,7 +71,8 @@ fixed_design_mb <- function( study_duration = 36, enroll_rate, fail_rate, - tau = 6) { + tau = 6, + w_max = Inf) { # Check inputs ---- check_enroll_rate(enroll_rate) check_fail_rate(fail_rate) @@ -88,7 +91,7 @@ fixed_design_mb <- function( # Generate design ---- weight <- function(x, arm0, arm1) { - wlr_weight_fh(x, arm0, arm1, rho = -1, gamma = 0, tau = tau) + wlr_weight_mb(x, arm0, arm1, tau = tau, w_max = w_max) } if (is.null(power)) { d <- gs_power_wlr( diff --git a/R/wlr_weight.R b/R/wlr_weight.R index 14592cb5..4cc8f7fd 100644 --- a/R/wlr_weight.R +++ b/R/wlr_weight.R @@ -29,7 +29,7 @@ #' @param rho A scalar parameter that controls the type of test. #' @param gamma A scalar parameter that controls the type of test. #' @param tau A scalar parameter of the cut-off time for modest weighted log rank test. -#' @param wmax A scalar parameter of the cut-off weight for modest weighted log rank test. +#' @param w_max A scalar parameter of the cut-off weight for modest weighted log rank test. #' @param power A scalar parameter that controls the power of the weight function. #' #' @section Specification: @@ -171,7 +171,7 @@ wlr_weight_n <- function(x, arm0, arm1, power = 1) { #' arm0 <- gs_arm$arm0 #' arm1 <- gs_arm$arm1 #' -#' wlr_weight_mb(1:3, arm0, arm1, tau = -1, wmax = 1.2) -wlr_weight_mb <- function(x, arm0, arm1, tau = NULL, wmax = Inf) { - pmin(wmax, wlr_weight_fh(x, arm0, arm1, rho = -1, gamma = 0, tau = tau)) +#' wlr_weight_mb(1:3, arm0, arm1, tau = -1, w_max = 1.2) +wlr_weight_mb <- function(x, arm0, arm1, tau = NULL, w_max = Inf) { + pmin(w_max, wlr_weight_fh(x, arm0, arm1, rho = -1, gamma = 0, tau = tau)) } diff --git a/man/fixed_design.Rd b/man/fixed_design.Rd index cd61ddba..113dd28c 100644 --- a/man/fixed_design.Rd +++ b/man/fixed_design.Rd @@ -62,7 +62,8 @@ fixed_design_mb( study_duration = 36, enroll_rate, fail_rate, - tau = 6 + tau = 6, + w_max = Inf ) fixed_design_milestone( @@ -117,6 +118,8 @@ and \code{1 - alpha} otherwise).} \item{tau}{Test parameter in RMST.} +\item{w_max}{Test parameter of Magirr-Burman method.} + \item{p_c}{A numerical value of the control arm rate.} \item{p_e}{A numerical value of the experimental arm rate.} @@ -289,7 +292,8 @@ x <- fixed_design_mb( dropout_rate = .001 ), study_duration = 36, - tau = 4 + tau = 4, + w_max = 2 ) x \%>\% summary() @@ -304,7 +308,8 @@ x <- fixed_design_mb( dropout_rate = .001 ), study_duration = 36, - tau = 4 + tau = 4, + w_max = 2 ) x \%>\% summary() diff --git a/man/wlr_weight.Rd b/man/wlr_weight.Rd index e1bcc5ca..c4a8bd0e 100644 --- a/man/wlr_weight.Rd +++ b/man/wlr_weight.Rd @@ -14,7 +14,7 @@ wlr_weight_1(x, arm0, arm1) wlr_weight_n(x, arm0, arm1, power = 1) -wlr_weight_mb(x, arm0, arm1, tau = NULL, wmax = Inf) +wlr_weight_mb(x, arm0, arm1, tau = NULL, w_max = Inf) } \arguments{ \item{x}{A vector of numeric values.} @@ -31,7 +31,7 @@ wlr_weight_mb(x, arm0, arm1, tau = NULL, wmax = Inf) \item{power}{A scalar parameter that controls the power of the weight function.} -\item{wmax}{A scalar parameter of the cut-off weight for modest weighted log rank test.} +\item{w_max}{A scalar parameter of the cut-off weight for modest weighted log rank test.} } \value{ A vector of weights. @@ -132,5 +132,5 @@ gs_arm <- gs_create_arm(enroll_rate, fail_rate, ratio = 1) arm0 <- gs_arm$arm0 arm1 <- gs_arm$arm1 -wlr_weight_mb(1:3, arm0, arm1, tau = -1, wmax = 1.2) +wlr_weight_mb(1:3, arm0, arm1, tau = -1, w_max = 1.2) }