Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable w_max = ... in fixed design mb #456

Merged
merged 7 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", role = c("aut")),
person("Yilong", "Zhang", email = "[email protected]", role = c("aut")),
Expand Down
13 changes: 8 additions & 5 deletions R/fixed_design_mb.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,7 +43,8 @@
#' dropout_rate = .001
#' ),
#' study_duration = 36,
#' tau = 4
#' tau = 4,
#' w_max = 2
#' )
#' x %>% summary()
#'
Expand All @@ -58,7 +59,8 @@
#' dropout_rate = .001
#' ),
#' study_duration = 36,
#' tau = 4
#' tau = 4,
#' w_max = 2
#' )
#' x %>% summary()
#'
Expand All @@ -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)
Expand All @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions R/wlr_weight.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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))
}
11 changes: 8 additions & 3 deletions man/fixed_design.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/wlr_weight.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.