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

Info-frac driven design does not work for gs_design_wlr() #441

Closed
LittleBeannie opened this issue Aug 1, 2024 · 1 comment · Fixed by #446
Closed

Info-frac driven design does not work for gs_design_wlr() #441

LittleBeannie opened this issue Aug 1, 2024 · 1 comment · Fixed by #446
Assignees
Labels
bug Something isn't working

Comments

@LittleBeannie
Copy link
Collaborator

LittleBeannie commented Aug 1, 2024

The following codes does not work.

library(gsDesign)
library(gsDesign2)


enroll_rate <- define_enroll_rate(duration = 12, rate = 450 / 12)

fail_rate <- define_fail_rate(
                              duration = c(6, Inf),
                              fail_rate = log(2) / 9,
                              hr = c(1, 0.5625),
                              dropout_rate = 0
                             )
# Efficacy boundaries only for the Modestly Weighted Logrank Test
dm <- gs_design_wlr(
  enroll_rate = enroll_rate,
  fail_rate = fail_rate,
  ratio = 1,
  beta = 0.1,
  weight = function(x, arm0, arm1) {
                                    wlr_weight_mb(x, arm0, arm1, tau = 12, wmax = Inf )
                                   },
  info_scale = "h0_h1_info",
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_b,
  lpar = rep(-Inf, 3),
  #analysis_time = c(18, 25, 36)  #works! 
  info_frac = c(0.48, 0.75, 1)        #does not work! 
)

dm

image

@LittleBeannie LittleBeannie added the bug Something isn't working label Aug 1, 2024
@LittleBeannie LittleBeannie self-assigned this Aug 1, 2024
@LittleBeannie LittleBeannie changed the title Info-frac driven design by WLR test Info-frac driven design does not work for gs_design_wlr() Aug 5, 2024
@LittleBeannie
Copy link
Collaborator Author

LittleBeannie commented Aug 12, 2024

Based on the current main branch of gsDesign2.

enroll_rate <- define_enroll_rate(duration = 12, rate = 1)
fail_rate <- define_fail_rate(duration = c(3, 100), fail_rate = log(2)/10, 
                              hr = c(1, 0.6), dropout_rate = 0.001)
ratio <- 1
event <- 1

gs_info_ahr(
  enroll_rate = enroll_rate,
  fail_rate = fail_rate,
  ratio = ratio,
  event = event,
  analysis_time = NULL
)

gs_info_wlr(
  enroll_rate = enroll_rate,
  fail_rate = fail_rate,
  ratio = ratio,
  event = event,
  analysis_time = NULL,
  weight = function(x, arm0, arm1) {wlr_weight_fh(x, arm0, arm1, rho = 0, gamma = 0, tau = NULL)}
) |> dplyr::select(-c(n, delta, sigma2))

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant