Skip to content

Commit

Permalink
Reduce interval for root finding
Browse files Browse the repository at this point in the history
  • Loading branch information
jdblischak committed Dec 19, 2023
1 parent 6d4371a commit afc5e6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gsDesign2
Title: Group Sequential Design with Non-Constant Effect
Version: 1.1.0.1
Version: 1.1.0.2
Authors@R: c(
person("Keaven", "Anderson", email = "[email protected]", role = c("aut")),
person("Yilong", "Zhang", email = "[email protected]", role = c("aut")),
Expand Down
1 change: 1 addition & 0 deletions R/expected_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ expected_time <- function(
target_event = 150,
ratio = 1,
interval = c(.01, 100)) {
print(interval)
# ----------------------------#
# check inputs #
# ----------------------------#
Expand Down
5 changes: 3 additions & 2 deletions R/gs_power_ahr.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
#' Normally, `r` will not be changed by the user.
#' @param tol Tolerance parameter for boundary convergence (on Z-scale).
#' @param interval An interval that is presumed to include the time at which
#' expected event count is equal to targeted event.
#' expected event count is equal to targeted event. If `analysis_time` is
#' defined, the upper limit of the interval is set to its maximum.
#'
#' @return A tibble with columns `Analysis`, `Bound`, `Z`, `Probability`,
#' `theta`, `Time`, `AHR`, `Events`.
Expand Down Expand Up @@ -171,7 +172,7 @@ gs_power_ahr <- function(
info_scale = c("h0_h1_info", "h0_info", "h1_info"),
r = 18,
tol = 1e-6,
interval = c(.01, 100)) {
interval = c(.01, if(is.null(analysis_time)) 100 else max(analysis_time))) {

Check warning on line 175 in R/gs_power_ahr.R

View workflow job for this annotation

GitHub Actions / lint

file=R/gs_power_ahr.R,line=175,col=25,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
# Get the number of analysis
n_analysis <- max(length(event), length(analysis_time), na.rm = TRUE)

Expand Down
5 changes: 3 additions & 2 deletions man/gs_power_ahr.Rd

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

0 comments on commit afc5e6a

Please sign in to comment.