Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

add RMST fixed design #28

Closed
elong0527 opened this issue Jul 9, 2022 · 4 comments
Closed

add RMST fixed design #28

elong0527 opened this issue Jul 9, 2022 · 4 comments
Assignees

Comments

@elong0527
Copy link
Collaborator

Based on the tutorial in npsurvSS, we can add fixed design output following the fix_design function in the issue4-table_bound branch.

@elong0527 elong0527 self-assigned this Jul 9, 2022
@LittleBeannie
Copy link
Collaborator

Hi @elong0527 , is it possible to have RMST available by the end of this week? Keaven will need that for the JSM presentation. If you have time conflict, I can help with your sec2 slides.

@fb-elong
Copy link
Contributor

@LittleBeannie, I just checked https://keaven.github.io/gsd-deming/index.html?q=RMST#welcome but could not find the code for RMST fixed design.

Could you share the original source code from previous training? I can start from there.

Also taking a quick look of the fixed_design function in issue-04-table-bound branch. Listed few action item for your consideration in #29.

@LittleBeannie
Copy link
Collaborator

In the slides "Sample Size for RMST":

gs_arm <- gsdmvn:::gs_create_arm(enrollRates, failRates, 
                                 ratio = 1,       # Randomization ratio
                                 total_time = 36) # Total study duration
arm0 <- gs_arm[["arm0"]]
arm1 <- gs_arm[["arm1"]]

# Sample size for RMST at cut point 36. 
npsurvSS::size_two_arm(arm0, arm1, power = 0.8, alpha = 0.025, 
                       test = list(test="rmst difference", 
                       # Milestone allow user to define RMST cutpoint
                       milestone = arm0$total_time))  

# Sample size for RMST at cut point 36. 
npsurvSS::size_two_arm(arm0, arm1, power = 0.8, alpha = 0.025, 
                       test = list(test="rmst difference", 
                       # Milestone allow user to define RMST cutpoint
                       milestone = 24))   

In the slide "Technical Details for RMST"

delta <- npsurvSS:::deltaj_rmst(arm0$total_time, arm1) - 
          npsurvSS:::deltaj_rmst(arm0$total_time, arm0)

sigma2 <- npsurvSS:::sigma2j_rmst(arm0, arm0$total_time) / 0.5 + 
            npsurvSS:::sigma2j_rmst(arm1, arm0$total_time) / 0.5

# Effect size
theta <- delta / sqrt(sigma2)

# Sample Size
z_alpha <- qnorm(1 - 0.025)
z_beta  <- qnorm(1 - 0.2)
n <- sigma2 * (z_alpha + z_beta)^2 / delta^2

# Number of Events
n0 = n1 = n / 2
gsdmvn:::prob_event.arm(arm0, tmax =  arm0$total_time) * n0 + 
  gsdmvn:::prob_event.arm(arm1, tmax =  arm0$total_time) * n1

# Compared with npsurvSS results
npsurvSS::size_two_arm(arm0, arm1, power = 0.8, alpha = 0.025, 
                       test = list(test="rmst difference", 
                       # Milestone allow user to define RMST cutpoint
                       milestone = arm0$total_time))    

@LittleBeannie
Copy link
Collaborator

Hi @elong0527 , please find a concrete sec 2 slides rmd in https://github.com/Merck/gsdmvn/tree/28-add-rmst-fixed-design/vignettes/nph_training_sec2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants