Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyyeoCH committed Oct 11, 2024
1 parent fc3bd8e commit 7ab498b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
13 changes: 8 additions & 5 deletions R/boundsPredprob.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#' Decision cutpoints for boundary (based on predictive probability) for Decision 1 rule.
#'
#' This function is used to identify the efficacy boundary and futility
#' boundary based on the following rules:
#' Efficacy boundary: find minimum x (xU) where
#' Pr(Pr(P > p0 | x, Y, a, b) >= tT | x) >= phiU,
#' Futility boundary: find maximum x (xL) where
#' Pr(Pr(P > p0 | x, Y, a, b) >= tT | x) =< phiL
#' boundary based on rules in @details.
#'
#' @inheritParams predprob
#' @inheritParams ocPredprob
Expand All @@ -27,6 +23,13 @@
#'
#' @importFrom stats binom.test
#'
#' @details see also `predprob()`
#' The following rules are Decision 1 rules:
#' Efficacy boundary: find minimum x (xU) where
#' Pr(Pr(response rate > p0 | data) >= tT | x) >= phiU,
#' Futility boundary: find maximum x (xL) where
#' Pr(Pr(response rate > p0 | data) >= tT | x) =< phiL
#'
#' @example examples/boundsPredprob.R
#' @export
#' @keywords graphics
Expand Down
10 changes: 7 additions & 3 deletions man/boundsPredprob.Rd

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

4 changes: 3 additions & 1 deletion tests/testthat/test-boundsPredprob.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ test_that("boundsPredprob gives correct result and when default weight is not as
)
expected <- data.frame(
list(
nvec = c(10, 20, 30, 40),
looks = c(10, 20, 30, 40),
xL = c(0, 2, 5, 9),
pL = c(0, 0.1, 0.1667, 0.225),
predL = c(0.0268, 0.0269, 0.0446, 0.0000),
postL = c(0.0859, 0.1787, 0.3931, 0.704),
UciL = c(0.2589, 0.2826, 0.319, 0.3598),
xU = c(4, 7, 9, 10),
pU = c(0.4, 0.35, 0.3, 0.25),
predU = c(0.9287, 0.9600, 0.9604, 1.0000),
postU = c(0.9496, 0.9569, 0.9254, 0.8177),
LciU = c(0.15, 0.1773, 0.1663, 0.1424)
)
Expand Down

0 comments on commit 7ab498b

Please sign in to comment.