Skip to content

Add gs_bound_summary() function #515

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

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

jdblischak
Copy link
Collaborator

Closes #468

xref: #498 (comment)

The goal is to create a summary table similar to gsDesign::gsBoundSummary(). This is an initial implementation. Please review and let me know where I need to add extra features and flexibility.

suppressPackageStartupMessages(library("gsDesign"))
x <- gsSurv(alpha = 0.01)
gsBoundSummary(x, alpha = c(0.0125, 0.025))
##     Analysis              Value α=0.01 α=0.0125 α=0.025 Futility
##    IA 1: 33%                  Z 3.2788   3.2153  3.0107  -0.0244
##       N: 234        p (1-sided) 0.0005   0.0007  0.0013   0.5097
##   Events: 71       ~HR at bound 0.4579   0.4649  0.4881   1.0058
##     Month: 8   P(Cross) if HR=1 0.0005   0.0007  0.0013   0.4903
##              P(Cross) if HR=0.6 0.1295   0.1434  0.1947   0.0148
##    IA 2: 67%                  Z 2.8566   2.7838  2.5465   1.2441
##       N: 332        p (1-sided) 0.0021   0.0027  0.0054   0.1067
##  Events: 141       ~HR at bound 0.6181   0.6257  0.6512   0.8110
##    Month: 13   P(Cross) if HR=1 0.0025   0.0031  0.0062   0.8986
##              P(Cross) if HR=0.6 0.5778   0.6061  0.6937   0.0437
##        Final                  Z 2.3695   2.2838  1.9992   2.3695
##       N: 332        p (1-sided) 0.0089   0.0112  0.0228   0.0089
##  Events: 212       ~HR at bound 0.7219   0.7305  0.7596   0.7219
##    Month: 18   P(Cross) if HR=1 0.0093   0.0114  0.0213   0.9907
##              P(Cross) if HR=0.6 0.9000   0.9107  0.9355   0.1000

suppressPackageStartupMessages(library(gsDesign2))

x <- gs_design_ahr(info_frac = c(.25, .75, 1), analysis_time = c(12, 25, 36))
gs_bound_summary(x)
##       Analysis               Value Efficacy Futility
## 1    IA 1: 31%                   Z   3.8728  -1.6993
## 2       N: 439         p (1-sided)   0.0001   0.9554
## 3   Events: 99        ~HR at bound   0.4600   1.4060
## 4    Month: 12    P(Cross) if HR=1   0.0001   0.0446
## 5              P(Cross) if AHR=0.8   0.0025   0.0032
## 6    IA 2: 77%                   Z   2.3100   1.0889
## 7       N: 527         p (1-sided)   0.0104   0.1381
## 8  Events: 248        ~HR at bound   0.7455   0.8707
## 9    Month: 25    P(Cross) if HR=1   0.0105   0.8620
## 10             P(Cross) if AHR=0.7   0.6348   0.0599
## 11       Final                   Z   2.0161   2.0143
## 12      N: 527         p (1-sided)   0.0219   0.0220
## 13 Events: 323        ~HR at bound   0.7990   0.7992
## 14   Month: 36    P(Cross) if HR=1   0.0243   0.9756
## 15             P(Cross) if AHR=0.7   0.9000   0.1001

x <- gs_design_wlr(info_frac = c(.25, .75, 1), analysis_time = c(12, 25, 36))
gs_bound_summary(x)
##       Analysis                Value Efficacy Futility
## 1    IA 1: 25%                    Z   4.2955  -2.0871
## 2       N: 436          p (1-sided)   0.0000   0.9816
## 3   Events: 99         ~HR at bound   0.4213   1.5219
## 4    Month: 12     P(Cross) if HR=1   0.0000   0.0184
## 5              P(Cross) if wAHR=0.8   0.0004   0.0012
## 6    IA 2: 76%                    Z   2.3156   1.1034
## 7       N: 523          p (1-sided)   0.0103   0.1349
## 8  Events: 246         ~HR at bound   0.7442   0.8687
## 9    Month: 25     P(Cross) if HR=1   0.0103   0.8651
## 10             P(Cross) if wAHR=0.7   0.6323   0.0610
## 11       Final                    Z   2.0151   2.0151
## 12      N: 523          p (1-sided)   0.0219   0.0219
## 13 Events: 321         ~HR at bound   0.7985   0.7985
## 14   Month: 36     P(Cross) if HR=1   0.0242   0.9758
## 15             P(Cross) if wAHR=0.7   0.9000   0.1000

@jdblischak jdblischak self-assigned this Mar 28, 2025
@jdblischak jdblischak changed the title [WIP] Add gs_bound_summary() function Add gs_bound_summary() function Mar 31, 2025
@jdblischak jdblischak marked this pull request as ready for review March 31, 2025 17:51
@jdblischak jdblischak requested a review from keaven March 31, 2025 17:56
@jdblischak
Copy link
Collaborator Author

Codecov coverage report available at https://app.codecov.io/gh/Merck/gsDesign2/pull/515

Copy link
Collaborator

@LittleBeannie LittleBeannie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Thanks, @jdblischak!

@LittleBeannie LittleBeannie merged commit 0348dac into Merck:main Apr 3, 2025
7 checks passed
@jdblischak jdblischak deleted the gs-bound-summary branch April 3, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gsBoundSummary() tables for gsDesign2
2 participants