Skip to content

Commit 5083088

Browse files
committed
clean
1 parent c661bdf commit 5083088

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

R/boundsPostprob.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#' Decision cutpoints for boundary (based on posterior probability)
22
#'
3+
#' @description `r lifecycle::badge("experimental")`
4+
#'
35
#' This function is used to identify the efficacy and futility
46
#' boundaries based on the following rules:
57
#' Efficacy boundary: find minimum x (xU) where Pr(RR > p1 | x, n, a, b) >= tU and
@@ -24,7 +26,7 @@
2426
#' @example examples/boundsPostprob.R
2527
#' @export
2628
boundsPostprob <- function(looks, p0, p1 = p0, tL, tU, parE = c(1, 1), weights) {
27-
assert_numeric(looks)
29+
assert_numeric(looks, any.missing = FALSE)
2830
assert_number(p0, lower = 0, upper = 1)
2931
assert_number(p1, lower = 0, upper = 1)
3032
assert_number(tL, lower = 0, upper = 1)

R/boundsPredprob.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#' Decision cutpoints for boundary (based on predictive probability) for Decision 1 rule.
22
#'
3+
#' @description `r lifecycle::badge("experimental")`
4+
#'
35
#' This function is used to identify the efficacy boundary and futility
46
#' boundary based on rules in @details.
57
#'
@@ -8,15 +10,15 @@
810
#' @inheritParams boundsPostprob
911
#' @return A matrix for each same size in `looks`. For each sample size, the following is returned:
1012
#' - `xL` : the maximum number of responses that meet the futility
11-
#' threshold
13+
#' threshold.
1214
#' - `pL` : response rate corresponding to `xL`.
1315
#' - `predL` : predictive probability corresponding to `xL`
1416
#' - `postL`: posterior probability corresponding to `xL`.
1517
#' - `pL_upper_ci` : upper bound of one sided 95% CI for the response rate based on an
1618
#' exact binomial test.
1719
#' - `xU` : the minimal number of responses that meet the efficacy threshold.
1820
#' - `pU` : response rate corresponding to `xU`.
19-
#' - `predU` : predictive probability corresponding to `xU`
21+
#' - `predU` : predictive probability corresponding to `xU`.
2022
#' - `postU`: posterior probability corresponding to `xU`.
2123
#' - `pU_lower_ci` : lower bound of one sided 95% CI for the response rate based on exact
2224
#' binomial test.
@@ -34,11 +36,11 @@
3436
#' @export
3537
#' @keywords graphics
3638
boundsPredprob <- function(looks, Nmax = max(looks), p0, tT, phiL, phiU, parE = c(1, 1), weights) {
37-
assert_numeric(looks)
39+
assert_numeric(looks, any.missing = FALSE)
3840
assert_number(p0, lower = 0, upper = 1)
3941
assert_number(tT, lower = 0, upper = 1)
40-
assert_number(phiU, lower = 0, upper = 1)
4142
assert_number(phiL, lower = 0, upper = 1)
43+
assert_number(phiU, lower = 0, upper = 1)
4244
assert_numeric(parE, min.len = 2, any.missing = FALSE)
4345
znames <- c(
4446
"xL", "pL", "predL", "postL", "UciL",
@@ -47,6 +49,7 @@ boundsPredprob <- function(looks, Nmax = max(looks), p0, tT, phiL, phiU, parE =
4749
z <- matrix(NA, length(looks), length(znames))
4850
dimnames(z) <- list(looks, znames)
4951
k <- 0
52+
assert_numeric(weights, min.len = 0, len = nrow(par), finite = TRUE)
5053
for (n in looks) {
5154
k <- k + 1
5255
# initialize so will return NA if 0 or n in "continue" region

man/boundsPostprob.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/boundsPredprob.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)