Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions R/ahr.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@
#' The piecewise exponential distribution allows a simple method to specify a distribution
#' and enrollment pattern where the enrollment, failure and dropout rates changes over time.
#'
#' @param enroll_rate An `enroll_rate` data frame with or without stratum
#' created by [define_enroll_rate()].
#' @param fail_rate A `fail_rate` data frame with or without stratum
#' created by [define_fail_rate()].
#' @inheritParams gs_design_ahr
#' @param total_duration Total follow-up from start of enrollment to data
#' cutoff; this can be a single value or a vector of positive numbers.
#' @param ratio Ratio of experimental to control randomization.
#'
#' @return A data frame with `time` (from `total_duration`),
#' `ahr` (average hazard ratio), `n` (sample size), `event` (expected number of events),
Expand Down
1 change: 0 additions & 1 deletion R/expected_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#'
#' @inheritParams ahr
#' @param target_event The targeted number of events to be achieved.
#' @param ratio Experimental:Control randomization ratio.
#' @param interval An interval that is presumed to include the time at which
#' expected event count is equal to `target_event`.
#'
Expand Down
40 changes: 5 additions & 35 deletions R/gs_design_ahr.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

#' Calculate sample size and bounds given targeted power and Type I error in group sequential design using average hazard ratio under non-proportional hazards
#' @inheritParams gs_power_design_npe
#'
#' @param enroll_rate Enrollment rates defined by \code{define_enroll_rate()}.
#' @param fail_rate Failure and dropout rates defined by \code{define_fail_rate()}.
#' @param enroll_rate An `enroll_rate` data frame with or without stratum
#' created by [define_enroll_rate()].
#' @param fail_rate A `fail_rate` data frame with or without stratum
#' created by [define_fail_rate()].
#' @param ratio Experimental:Control randomization ratio.
#' @param alpha One-sided Type I error.
#' @param beta Type II error.
#' @param info_frac Targeted information fraction for analyses. See details.
#' @param analysis_time Targeted calendar timing of analyses. See details.
#' @param binding Indicator of whether futility bound is binding;
#' default of `FALSE` is recommended.
#' @param upper Function to compute upper bound.
#' - \code{gs_spending_bound()}: alpha-spending efficacy bounds.
#' - \code{gs_b()}: fixed efficacy bounds.
#' @param upar Parameters passed to `upper`.
#' - If `upper = gs_b`, then `upar` is a numerical vector specifying the fixed efficacy bounds per analysis.
#' - If `upper = gs_spending_bound`, then `upar` is a list including
#' - `sf` for the spending function family.
#' - `total_spend` for total alpha spend.
#' - `param` for the parameter of the spending function.
#' - `timing` specifies spending time if different from information-based spending; see details.
#' @param lower Function to compute lower bound, which can be set up similarly as `upper`.
#' See [this vignette](https://merck.github.io/gsDesign2/articles/story-seven-test-types.html).
#' @param lpar Parameters passed to `lower`, which can be set up similarly as `upar.`
#' @param info_scale Information scale for calculation. Options are:
#' - `"h0_h1_info"` (default): variance under both null and alternative hypotheses is used.
#' - `"h0_info"`: variance under null hypothesis is used.
#' - `"h1_info"`: variance under alternative hypothesis is used.
#' @param h1_spending Indicator that lower bound to be set by spending
#' under alternate hypothesis (input `fail_rate`)
#' if spending is used for lower bound.
#' If this is `FALSE`, then the lower bound spending is under the null hypothesis.
#' This is for two-sided symmetric or asymmetric testing under the null hypothesis;
#' See [this vignette](https://merck.github.io/gsDesign2/articles/story-seven-test-types.html).
#' @param test_upper Indicator of which analyses should include an upper
#' (efficacy) bound; single value of `TRUE` (default) indicates all analyses;
#' otherwise, a logical vector of the same length as `info` should indicate
#' which analyses will have an efficacy bound.
#' @param test_lower Indicator of which analyses should include an lower bound;
#' single value of `TRUE` (default) indicates all analyses;
#' single value `FALSE` indicated no lower bound; otherwise, a logical vector
#' of the same length as `info` should indicate which analyses will have a
#' lower bound.
#' @param r Integer value controlling grid for numerical integration as in
#' Jennison and Turnbull (2000); default is 18, range is 1 to 80.
#' Larger values provide larger number of grid points and greater accuracy.
#' Normally, `r` will not be changed by the user.
#' @param tol Tolerance parameter for boundary convergence (on Z-scale); normally not changed by the user.
#' @param interval An interval presumed to include the times at which
#' expected event count is equal to targeted event.
#' Normally, this can be ignored by the user as it is set to `c(.01, 1000)`.
Expand Down
15 changes: 12 additions & 3 deletions R/gs_power_npe.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,18 @@
#' @param binding Indicator of whether futility bound is binding;
#' default of `FALSE` is recommended.
#' @param upper Function to compute upper bound.
#' @param lower Function to compare lower bound.
#' - \code{gs_spending_bound()}: alpha-spending efficacy bounds.
#' - \code{gs_b()}: fixed efficacy bounds.
#' @param lower Function to compute lower bound, which can be set up similarly as `upper`.
#' See [this vignette](https://merck.github.io/gsDesign2/articles/story-seven-test-types.html).
#' @param upar Parameters passed to `upper`.
#' @param lpar parameters passed to `lower`.
#' - If `upper = gs_b`, then `upar` is a numerical vector specifying the fixed efficacy bounds per analysis.
#' - If `upper = gs_spending_bound`, then `upar` is a list including
#' - `sf` for the spending function family.
#' - `total_spend` for total alpha spend.
#' - `param` for the parameter of the spending function.
#' - `timing` specifies spending time if different from information-based spending; see details.
#' @param lpar Parameters passed to `lower`, which can be set up similarly as `upar.`
#' @param test_upper Indicator of which analyses should include
#' an upper (efficacy) bound;
#' single value of `TRUE` (default) indicates all analyses; otherwise,
Expand All @@ -86,7 +95,7 @@
#' Jennison and Turnbull (2000); default is 18, range is 1 to 80.
#' Larger values provide larger number of grid points and greater accuracy.
#' Normally, `r` will not be changed by the user.
#' @param tol Tolerance parameter for boundary convergence (on Z-scale).
#' @param tol Tolerance parameter for boundary convergence (on Z-scale); normally not changed by the user.
#'
#' @return A tibble with columns of
#' - `analysis`: analysis index.
Expand Down
6 changes: 1 addition & 5 deletions R/pw_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@
#' The piecewise exponential distribution allows a simple method to specify a distribution
#' and enrollment pattern where the enrollment, failure and dropout rates changes over time.
#'
#' @param enroll_rate An `enroll_rate` data frame with or without stratum
#' created by [define_enroll_rate()].
#' @param fail_rate A `fail_rate` data frame with or without stratum
#' created by [define_fail_rate()].
#' @inheritParams ahr
#' @param total_duration Total follow-up from start of enrollment to data
#' cutoff; this can be a single value or a vector of positive numbers.
#' @param ratio Ratio of experimental to control randomization.
#'
#' @return A data frame with `time` (from `total_duration`), `stratum`, `t`,
#' `hr` (hazard ratio), `event` (expected number of events), `info`
Expand Down
2 changes: 1 addition & 1 deletion man/ahr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/fixed_design.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions man/gs_design_ahr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/gs_design_combo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions man/gs_design_wlr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions man/gs_power_ahr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/gs_power_combo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions man/gs_power_design_npe.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading