Add an example showing how to update a stratified design at the time analysis#608
Conversation
jdblischak
left a comment
There was a problem hiding this comment.
Overall looks good.
A big picture question (that doesn't have to be addressed for this PR): when is an example long enough that a vignette would be the better option?
| #' # After the delayed effect, the HR is 0.8 for stratum A and 0.5 for stratum B. | ||
| #' fail_rate <- define_fail_rate(stratum = c("A", "A", "B", "B"), | ||
| #' duration = c(3, Inf, 3, Inf), | ||
| #' fail_rate = log(2) / c(9, 9, 9, 15), |
There was a problem hiding this comment.
Does it deserve a comment why the failure rate is different only for stratum B after the delayed effect?
There was a problem hiding this comment.
Thanks for your suggestions. These are really nice comments!
When is an example long enough that a vignette would be the better option?
The vignettes are typically more narrative-driven, which is the style Keaven prefers.
Although this example is lengthy, its primary focus is on demonstrating implementation rather than telling a complex story. Therefore, let's categorize it as an "example" for now, not a full vignette.
Does it deserve a comment why the failure rate is different only for stratum B after the delayed effect?
You identified the key consideration here! Typically, the median of the control arm is assumed to be constant. However, in some scenarios, it can be modeled as time-varying. This example demostrates that gsDesign2 is able to do time-varying median. Since the primary goal is for users to adapt the code and input their own study-specific parameters, the current example is sufficient.
To solve issue #606