12
12
# ' - `pL` : response rate corresponding to `xL`.
13
13
# ' - `predL` : predictive probability corresponding to `xL`
14
14
# ' - `postL`: posterior probability corresponding to `xL`.
15
- # ' - `Ucil ` : upper bound of one sided 95% CI for the response rate based on an
15
+ # ' - `pL_upper_ci ` : upper bound of one sided 95% CI for the response rate based on an
16
16
# ' exact binomial test.
17
17
# ' - `xU` : the minimal number of responses that meet the efficacy threshold.
18
18
# ' - `pU` : response rate corresponding to `xU`.
19
19
# ' - `predU` : predictive probability corresponding to `xU`
20
20
# ' - `postU`: posterior probability corresponding to `xU`.
21
- # ' - `LciU ` : lower bound of one sided 95% CI for the response rate based on exact
21
+ # ' - `pU_lower_ci ` : lower bound of one sided 95% CI for the response rate based on exact
22
22
# ' binomial test.
23
23
# '
24
24
# ' @importFrom stats binom.test
@@ -37,6 +37,8 @@ boundsPredprob <- function(looks, Nmax = max(looks), p0, tT, phiL, phiU, parE =
37
37
assert_numeric(looks )
38
38
assert_number(p0 , lower = 0 , upper = 1 )
39
39
assert_number(tT , lower = 0 , upper = 1 )
40
+ assert_number(phiU , lower = 0 , upper = 1 )
41
+ assert_number(phiL , lower = 0 , upper = 1 )
40
42
assert_numeric(parE , min.len = 2 , any.missing = FALSE )
41
43
znames <- c(
42
44
" xL" , " pL" , " predL" , " postL" , " UciL" ,
@@ -52,11 +54,11 @@ boundsPredprob <- function(looks, Nmax = max(looks), p0, tT, phiL, phiU, parE =
52
54
xU <- NA
53
55
for (x in 0 : n ) {
54
56
predprob <- predprob(x = x , n = n , Nmax = max(looks ), p = p0 , thetaT = tT , parE = parE , weights = weights )$ result
55
- if (predprob < = phiL ) { # Futility look, Rule Pr(Pr(P > p0 | x, Y, a, b ) >= tT | x) =< phiL
57
+ if (predprob < = phiL ) { # Futility look, Rule Pr(Pr( RR > p0 | x, Y) >= tT | x) =< phiL
56
58
xL <- x
57
59
predL <- predprob
58
60
}
59
- if (predprob > = phiU ) { # Efficacy look, Rule Pr(Pr(P > p0 | x, Y, a, b ) >= tT | x) >= phiU,
61
+ if (predprob > = phiU ) { # Efficacy look, Rule Pr(Pr( RR > p0 | x, Y) >= tT | x) >= phiU,
60
62
xU <- x
61
63
predU <- predprob
62
64
break
0 commit comments