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# '
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.
3436# ' @export
3537# ' @keywords graphics
3638boundsPredprob <- 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
0 commit comments