Skip to content

Add arg alpha to gs_bound_summary() to report multiple efficacy bounds #535

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 2 commits into from
Apr 29, 2025

Conversation

jdblischak
Copy link
Collaborator

@jdblischak jdblischak commented Apr 24, 2025

Closes #522

xref: #468, #515

Still some open questions:

library("gsDesign2")

x <- gs_design_ahr(analysis_time = 1:3*12, alpha = 0.0125)
gs_bound_summary(x, alpha = c(0.025, 0.05))
##       Analysis               Value α=0.0125 α=0.025 α=0.05 Futility
## 1    IA 1: 31%                   Z   4.3506  3.8728 3.3437  -1.6192
## 2       N: 509         p (1-sided)   0.0000  0.0001 0.0004   0.9473
## 3  Events: 115        ~HR at bound   0.4449  0.4863 0.5366   1.3518
## 4    Month: 12    P(Cross) if HR=1   0.0000  0.0001 0.0004   0.0527
## 5              P(Cross) if AHR=0.8   0.0007  0.0032 0.0139   0.0032
## 6    IA 2: 74%                   Z   2.6778  2.3579 2.0022   1.1590
## 7       N: 611         p (1-sided)   0.0037  0.0092 0.0226   0.1232
## 8  Events: 278        ~HR at bound   0.7251  0.7535 0.7863   0.8701
## 9    Month: 24    P(Cross) if HR=1   0.0037  0.0092 0.0228   0.8768
## 10             P(Cross) if AHR=0.7   0.5336  0.6571 0.7770   0.0556
## 11       Final                   Z   2.2781  2.0096 1.7134   2.2775
## 12      N: 611         p (1-sided)   0.0114  0.0222 0.0433   0.0114
## 13 Events: 375        ~HR at bound   0.7903  0.8125 0.8378   0.7903
## 14   Month: 36    P(Cross) if HR=1   0.0122  0.0237 0.0445   0.9878
## 15             P(Cross) if AHR=0.7   0.9000  0.9252 0.9390   0.1001

@jdblischak jdblischak self-assigned this Apr 24, 2025
https://www.ascii-code.com/character/%CE%B1

W  checking R files for non-ASCII characters ...
   Found the following file with non-ASCII characters:
     gs_bound_summary.R
   Portable packages must use only ASCII characters in their R code,
   except perhaps in comments.
   Use \uxxxx escapes for other characters.
@LittleBeannie
Copy link
Collaborator

Thank you, @jdblischak! Here, please find my answer to the questions above.

Only supported for AHR design objects?

Yes. If it is WLR design, some rownames are changed.
image

How to properly support design objects created by gs_power_ahr()? Currently I don't treat them any different that design objects created by gs_design_ahr()

The design objects created by gs_power_ahr and gs_design_ahr are gs_bound_summary in the same way. Their textual summary is different, but their table summary (as-gt table, or gs_bound_summary table) is the same.

@jdblischak
Copy link
Collaborator Author

Yes. If it is WLR design, some rownames are changed.

I was specifically asking about the new argument alpha described in #522. The rownames for WLR designs are already supported by my original PR #515.

Specifically, in #522, you describe how to use gs_update_ahr(). The function gs_update_wlr() does not exist, so I do not know how to implement the argument alpha for WLR designs.

@jdblischak
Copy link
Collaborator Author

The design objects created by gs_power_ahr and gs_design_ahr are gs_bound_summary in the same way. Their textual summary is different, but their table summary (as-gt table, or gs_bound_summary table) is the same.

Does that mean it is ok if gs_summary_bound() obtains the original alpha using x[["input"]][["alpha"]] for design objects created by either gs_design_ahr() or gs_power_ahr()?

@LittleBeannie
Copy link
Collaborator

Yes. If it is WLR design, some rownames are changed.

I was specifically asking about the new argument alpha described in #522. The rownames for WLR designs are already supported by my original PR #515.

Specifically, in #522, you describe how to use gs_update_ahr(). The function gs_update_wlr() does not exist, so I do not know how to implement the argument alpha for WLR designs.

Yes, you are correct that we need gs_update_wlr(). Its development is currently pending as I am working on the analytical derivation. For now, it is acceptable to have gs_bound_summary support multiple alpha levels for the ahr method only.

@LittleBeannie
Copy link
Collaborator

The design objects created by gs_power_ahr and gs_design_ahr are gs_bound_summary in the same way. Their textual summary is different, but their table summary (as-gt table, or gs_bound_summary table) is the same.

Does that mean it is ok if gs_summary_bound() obtains the original alpha using x[["input"]][["alpha"]] for design objects created by either gs_design_ahr() or gs_power_ahr()?

Yes

@jdblischak
Copy link
Collaborator Author

@LittleBeannie Thanks for answering my questions! I updated my original description above with these additional details. This PR is ready for review now

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.

Thanks, @jdblischak! It looks good to me.

@LittleBeannie LittleBeannie merged commit bf4db9c into Merck:main Apr 29, 2025
7 checks passed
@jdblischak jdblischak deleted the multiple-alpha branch April 29, 2025 18:58
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.

Generalize gs_bound_summary for supporting multiple alpha
2 participants