-
Notifications
You must be signed in to change notification settings - Fork 8
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
gs_design_ahr()
derives info
of all infinity values
#301
Comments
It appears using library(gsDesign2)
design <- gs_design_ahr(
enroll_rate = define_enroll_rate(
duration = c(2, 2, 10),
rate = c(3, 6, 9),
),
fail_rate = define_fail_rate(
duration = 40,
fail_rate = 0.0495,
dropout_rate = 0.001,
hr = 1
),
alpha = 0.0125,
beta = 0.2,
info_frac = NULL,
analysis_time = 36,
ratio = 1,
binding = FALSE,
upper = gs_spending_bound,
upar = list(
sf = gsDesign::sfLDOF,
sfupar = 1,
total_spend = 0.0125,
param = NULL,
timing = NULL
),
lower = gs_b,
lpar = c(0, -Inf, -Inf),
r = 18,
tol = 1e-6
)
design |> to_integer()
|
I checked some previous commits to see if this is a recent bug. I can only go back so far since the example uses Running the example above with either commits 03d6a52 or 107265a, I get the same error from Error in if (min(info - lag(info, default = 0)) <= 0) { :
missing value where TRUE/FALSE needed
> traceback()
6: check_info(info) at gs_power_npe.R#253
5: gs_power_npe(theta = theta, theta0 = theta0, theta1 = theta1,
info = info * min_x, info0 = info0 * min_x, info1 = info *
min_x, info_scale = info_scale, upper = upper, upar = upar,
test_upper = test_upper, lower = lower, lpar = lpar, test_lower = test_lower,
binding = binding, r = r, tol = tol) at gs_design_npe.R#375
4: gs_design_npe(theta = y$theta, theta0 = 0, theta1 = theta1, info = y$info,
info0 = y$info0, info1 = info1, info_scale = info_scale,
alpha = alpha, beta = beta, binding = binding, upper = upper,
upar = upar, test_upper = test_upper, lower = lower, lpar = lpar,
test_lower = test_lower, r = r, tol = tol) at gs_design_ahr.R#322
3: withCallingHandlers(expr, message = function(c) if (inherits(c,
classes)) tryInvokeRestart("muffleMessage"))
2: suppressMessages(allout <- gs_design_npe(theta = y$theta, theta0 = 0,
theta1 = theta1, info = y$info, info0 = y$info0, info1 = info1,
info_scale = info_scale, alpha = alpha, beta = beta, binding = binding,
upper = upper, upar = upar, test_upper = test_upper, lower = lower,
lpar = lpar, test_lower = test_lower, r = r, tol = tol)) at gs_design_ahr.R#322
1: gs_design_ahr(enroll_rate = define_enroll_rate(duration = c(2,
2, 10), rate = c(3, 6, 9), ), fail_rate = define_fail_rate(duration = 40,
fail_rate = 0.0495, dropout_rate = 0.001, hr = 1), alpha = 0.0125,
beta = 0.2, info_frac = c(0.4, 0.8, 1), analysis_time = 36,
ratio = 1, binding = FALSE, upper = gs_spending_bound, upar = list(sf = gsDesign::sfLDOF,
sfupar = 1, total_spend = 0.0125, param = NULL, timing = NULL),
lower = gs_b, lpar = c(0, -Inf, -Inf), r = 18, tol = 1e-06) |
Hello @nanxstats , thank you for raising this important question. I would like to understand the reason behind setting |
@LittleBeannie Sure, from Keaven:
|
POC:
This yields:
The call stack is:
When I insert
print(info)
before theif
call incheck_info()
, it looks likeinfo
has become purelyInf
:Naturally,
returns
NA
.The text was updated successfully, but these errors were encountered: