Skip to contents

[Experimental]

Compute the predictive probability of trial success given current data.

Success means that at the end of the trial the posterior probability is: Pr(P_E > P_S + delta_0 | data) >= thetaT.

Where P_E is the response rate of the treatment or Egroup and P_S is the response rate of the standard of care of S group.

Then the predictive probability for success is: pp = sum over i: Pr(Y = i | x , n)*I{Pr(P_E > P_S + delta | x,Y=i) >= thetaT}, where Y is the number of future responses in the treatment group and x is the current number of responses in the treatment group out of n. Please see note in postprobDist() for definition of delta and relativeDelta. Prior is P_E ~ beta(a, b) and uniform is a beta(1,1). However, a beta mixture prior can also be specified. Analogously for P_S either a uniform beta prior or a beta mixture prior can be specified.

Also data on the S might be available. Then the predictive probability is more generally defined as : pp = sum over i, j: Pr(Y = i | x, n)*Pr(Z = j | xS, nS )*I{Pr(P_E > P_S + delta | x,xS, Y=i, Z=j ) >= thetaT} where Z is the future number of responses in the S group, and xS is the current number of responses in the S group.

In the case where NmaxControl = 0, a table with the following contents will be included in the return output :

  • counts: Y = i, number of future successes in Nmax-n subjects in ascending order.

  • cumul_counts: Y = i, number of future successes in Nmax-n subjects.

  • density: Pr(Y = i|x) using beta-(mixture)-binomial distribution.

  • posterior: Pr(P_E > P_S + delta | x, Y = i) using beta posterior.

  • success: indicator I( b > thetaT ).

If NmaxControl is not zero, i.e., when data on the control treatment is available in this trial, then a list with the following contents will be included in the return output :

  • counts: Y = i, number of future successes in Nmax-n subjects in ascending order.

  • cumul_counts: Y = i, number of future successes in Nmax-n subjects.

  • density: Pr(Y = i|x) using beta-(mixture)-binomial distribution.

  • posterior: Pr(P_E > P_S + delta | x, Y = i) using beta posterior.

  • success: indicator I( b > thetaT ).

Usage

predprobDist(
  x,
  n,
  xS = 0,
  nS = 0,
  Nmax,
  NmaxControl = 0,
  delta = 0,
  relativeDelta = FALSE,
  parE = c(a = 1, b = 1),
  weights,
  parS = c(a = 1, b = 1),
  weightsS,
  thetaT
)

Arguments

x

(number):
number of successes in the E group at interim.

n

(number):
number of patients in the E group at interim.

xS

(number):
number of successes in the S group at interim.

nS

(number):
number of patients in the E group at interim.

Nmax

(number):
maximum number of patients in the E group at final analysis.

NmaxControl

(number):
maximum number of patients in the S group at final analysis.

delta

(number):
difference between response rates to be met.

relativeDelta

(flag):
If TRUE, then a relativeDelta is used. Represents that a minimum response rate in magnitude of delta of the S non-responding patients. See postprobDist().

parE

(numeric):
parameters for beta distribution. If it is a matrix, it needs to have 2 columns, and each row corresponds to each component of a beta-mixture distribution for the E group.

weights

(numeric):
the mixture weights of the beta mixture prior.

parS

(numeric):
parameters for beta distribution. If it is a matrix, it needs to have 2 columns, and each row corresponds to each component of a beta-mixture distribution for the S group.

weightsS

(numeric):
weights for the S group.

thetaT

(number):
threshold on the probability to be used.

Value

A list is returned with names result for predictive probability including or separately a table of numeric values with counts of responses in the remaining patients, density for probabilities of these counts, posterior for corresponding probabilities to be above threshold, and successfor trial success indicators.

References

Lee, J. J., & Liu, D. D. (2008). A predictive probability design for phase II cancer clinical trials. Clinical Trials, 5(2), 93-106. doi:10.1177/1740774508089279

Examples

predprobDist(
  x = 16, n = 23, Nmax = 40, delta = 0, thetaT = 0.9,
  parE = c(0.6, 0.4), parS = c(7, 11)
)
#> $result
#> [1] 0.9778204
#> 
#> $table
#>    counts cumul_counts      density posterior success
#> 1       0           16 1.885196e-06 0.5530716   FALSE
#> 2       1           17 2.273514e-05 0.6214508   FALSE
#> 3       2           18 1.429066e-04 0.6856889   FALSE
#> 4       3           19 6.210428e-04 0.7444267   FALSE
#> 5       4           20 2.088409e-03 0.7967127   FALSE
#> 6       5           21 5.765730e-03 0.8420189   FALSE
#> 7       6           22 1.353693e-02 0.8802192   FALSE
#> 8       7           23 2.762957e-02 0.9115393    TRUE
#> 9       8           24 4.969953e-02 0.9364854    TRUE
#> 10      9           25 7.939015e-02 0.9557619    TRUE
#> 11     10           26 1.129104e-01 0.9701884    TRUE
#> 12     11           27 1.426318e-01 0.9806229    TRUE
#> 13     12           28 1.587354e-01 0.9878972    TRUE
#> 14     13           29 1.531657e-01 0.9927688    TRUE
#> 15     14           30 1.245523e-01 0.9958900    TRUE
#> 16     15           31 8.109152e-02 0.9977932    TRUE
#> 17     16           32 3.813232e-02 0.9988905    TRUE
#> 18     17           33 9.881666e-03 0.9994836    TRUE
#> 
# Specifying delta.
predprobDist(
  x = 16, n = 23, Nmax = 40, delta = 0.1, thetaT = 0.9,
  parE = c(1, 1), parS = c(6, 11)
)
#> $result
#> [1] 0.8004621
#> 
#> $table
#>    counts cumul_counts      density posterior success
#> 1       0           16 2.283242e-06 0.3716084   FALSE
#> 2       1           17 2.749403e-05 0.4400664   FALSE
#> 3       2           18 1.721366e-04 0.5092459   FALSE
#> 4       3           19 7.433170e-04 0.5772595   FALSE
#> 5       4           20 2.477723e-03 0.6423841   FALSE
#> 6       5           21 6.764185e-03 0.7031617   FALSE
#> 7       6           22 1.566443e-02 0.7584690   FALSE
#> 8       7           23 3.145318e-02 0.8075520   FALSE
#> 9       8           24 5.550560e-02 0.8500272   FALSE
#> 10      9           25 8.672751e-02 0.8858553   FALSE
#> 11     10           26 1.202621e-01 0.9152925    TRUE
#> 12     11           27 1.475944e-01 0.9388274    TRUE
#> 13     12           28 1.589479e-01 0.9571117    TRUE
#> 14     13           29 1.477400e-01 0.9708907    TRUE
#> 15     14           30 1.151221e-01 0.9809398    TRUE
#> 16     15           31 7.137569e-02 0.9880117    TRUE
#> 17     16           32 3.172253e-02 0.9927963    TRUE
#> 18     17           33 7.697378e-03 0.9958932    TRUE
#> 

# Lowering theta increases predictive probability.
predprobDist(
  x = 16, n = 23, Nmax = 40, delta = 0.1, thetaT = 0.5,
  parE = c(1, 1), parS = c(6, 11)
)
#> $result
#> [1] 0.9999702
#> 
#> $table
#>    counts cumul_counts      density posterior success
#> 1       0           16 2.283242e-06 0.3716084   FALSE
#> 2       1           17 2.749403e-05 0.4400664   FALSE
#> 3       2           18 1.721366e-04 0.5092459    TRUE
#> 4       3           19 7.433170e-04 0.5772595    TRUE
#> 5       4           20 2.477723e-03 0.6423841    TRUE
#> 6       5           21 6.764185e-03 0.7031617    TRUE
#> 7       6           22 1.566443e-02 0.7584690    TRUE
#> 8       7           23 3.145318e-02 0.8075520    TRUE
#> 9       8           24 5.550560e-02 0.8500272    TRUE
#> 10      9           25 8.672751e-02 0.8858553    TRUE
#> 11     10           26 1.202621e-01 0.9152925    TRUE
#> 12     11           27 1.475944e-01 0.9388274    TRUE
#> 13     12           28 1.589479e-01 0.9571117    TRUE
#> 14     13           29 1.477400e-01 0.9708907    TRUE
#> 15     14           30 1.151221e-01 0.9809398    TRUE
#> 16     15           31 7.137569e-02 0.9880117    TRUE
#> 17     16           32 3.172253e-02 0.9927963    TRUE
#> 18     17           33 7.697378e-03 0.9958932    TRUE
#> 

# Beta-mixture prior for experimental arm.
predprobDist(
  x = 16,
  n = 23,
  Nmax = 40,
  delta = 0.1,
  thetaT = 0.9,
  parE = rbind(c(1, 1), c(2, 6)),
  weights = c(2, 1),
  parS = c(6, 11)
)
#> $result
#> [1] 0.7832483
#> 
#> $table
#>    counts cumul_counts      density posterior success
#> 1       0           16 3.507384e-06 0.3380374   FALSE
#> 2       1           17 4.016071e-05 0.4051061   FALSE
#> 3       2           18 2.392160e-04 0.4743698   FALSE
#> 4       3           19 9.839819e-04 0.5438945   FALSE
#> 5       4           20 3.130387e-03 0.6117564   FALSE
#> 6       5           21 8.176955e-03 0.6761812   FALSE
#> 7       6           22 1.817373e-02 0.7356662   FALSE
#> 8       7           23 3.514374e-02 0.7890733   FALSE
#> 9       8           24 5.995174e-02 0.8356823   FALSE
#> 10      9           25 9.090828e-02 0.8752013   FALSE
#> 11     10           26 1.228218e-01 0.9077345    TRUE
#> 12     11           27 1.474352e-01 0.9337167    TRUE
#> 13     12           28 1.558746e-01 0.9538263    TRUE
#> 14     13           29 1.427235e-01 0.9688894    TRUE
#> 15     14           30 1.098938e-01 0.9797895    TRUE
#> 16     15           31 6.750847e-02 0.9873913    TRUE
#> 17     16           32 2.979691e-02 0.9924843    TRUE
#> 18     17           33 7.194001e-03 0.9957484    TRUE
#> 

# More extensive use of historical trials for control arm.
predprobDist(
  x = 16,
  n = 23,
  xS = 5,
  nS = 10,
  Nmax = 40,
  NmaxControl = 20,
  delta = 0.1,
  thetaT = 0.9,
  parE = rbind(c(1, 1), c(3, 5)),
  weights = c(2, 1),
  parS = rbind(c(1, 1), c(2, 6)),
  weightsS = c(2, 1)
)
#> $result
#> [1] 0.3112107
#> 
#> $table
#>    counts cumul_counts
#> 1       0           16
#> 2       1           17
#> 3       2           18
#> 4       3           19
#> 5       4           20
#> 6       5           21
#> 7       6           22
#> 8       7           23
#> 9       8           24
#> 10      9           25
#> 11     10           26
#> 12     11           27
#> 13     12           28
#> 14     13           29
#> 15     14           30
#> 16     15           31
#> 17     16           32
#> 18     17           33
#> 
#> $density
#>               0            1            2            3            4
#> 0  4.453717e-08 1.664846e-07 3.455838e-07 5.195113e-07 6.234662e-07
#> 1  5.249172e-07 1.962196e-06 4.073067e-06 6.122985e-06 7.348202e-06
#> 2  3.199497e-06 1.196006e-05 2.482633e-05 3.732107e-05 4.478907e-05
#> 3  1.338575e-05 5.003734e-05 1.038660e-04 1.561403e-04 1.873842e-04
#> 4  4.304548e-05 1.609086e-04 3.340092e-04 5.021113e-04 6.025844e-04
#> 5  1.129542e-04 4.222348e-04 8.764624e-04 1.317574e-03 1.581222e-03
#> 6  2.506692e-04 9.370281e-04 1.945055e-03 2.923974e-03 3.509065e-03
#> 7  4.812191e-04 1.798848e-03 3.733994e-03 5.613261e-03 6.736482e-03
#> 8  8.106425e-04 3.030267e-03 6.290138e-03 9.455876e-03 1.134801e-02
#> 9  1.208202e-03 4.516386e-03 9.374979e-03 1.409328e-02 1.691336e-02
#> 10 1.598271e-03 5.974507e-03 1.240170e-02 1.864331e-02 2.237386e-02
#> 11 1.873110e-03 7.001883e-03 1.453430e-02 2.184921e-02 2.622126e-02
#> 12 1.929900e-03 7.214171e-03 1.497496e-02 2.251165e-02 2.701626e-02
#> 13 1.720860e-03 6.432757e-03 1.335292e-02 2.007326e-02 2.408995e-02
#> 14 1.290869e-03 4.825405e-03 1.001643e-02 1.505756e-02 1.807060e-02
#> 15 7.736242e-04 2.891889e-03 6.002896e-03 9.024070e-03 1.082980e-02
#> 16 3.338710e-04 1.248045e-03 2.590654e-03 3.894494e-03 4.673787e-03
#> 17 7.904304e-05 2.954712e-04 6.133303e-04 9.220109e-04 1.106506e-03
#>               5            6            7            8            9
#> 0  6.236829e-07 5.279150e-07 3.752095e-07 2.159072e-07 9.178787e-08
#> 1  7.350756e-06 6.222031e-06 4.422237e-06 2.544692e-06 1.081816e-06
#> 2  4.480464e-05 3.792478e-05 2.695460e-05 1.551052e-05 6.593931e-06
#> 3  1.874493e-04 1.586661e-04 1.127701e-04 6.489141e-05 2.758706e-05
#> 4  6.027938e-04 5.102335e-04 3.626426e-04 2.086758e-04 8.871361e-05
#> 5  1.581771e-03 1.338887e-03 9.515984e-04 5.475792e-04 2.327904e-04
#> 6  3.510284e-03 2.971272e-03 2.111797e-03 1.215194e-03 5.166111e-04
#> 7  6.738823e-03 5.704062e-03 4.054096e-03 2.332853e-03 9.917576e-04
#> 8  1.135195e-02 9.608835e-03 6.829369e-03 3.929831e-03 1.670675e-03
#> 9  1.691924e-02 1.432125e-02 1.017866e-02 5.857119e-03 2.490016e-03
#> 10 2.238163e-02 1.894488e-02 1.346486e-02 7.748097e-03 3.293921e-03
#> 11 2.623037e-02 2.220264e-02 1.578027e-02 9.080458e-03 3.860343e-03
#> 12 2.702564e-02 2.287580e-02 1.625871e-02 9.355766e-03 3.977384e-03
#> 13 2.409832e-02 2.039797e-02 1.449762e-02 8.342382e-03 3.546568e-03
#> 14 1.807688e-02 1.530113e-02 1.087510e-02 6.257873e-03 2.660387e-03
#> 15 1.083356e-02 9.170044e-03 6.517503e-03 3.750374e-03 1.594383e-03
#> 16 4.675412e-03 3.957492e-03 2.812742e-03 1.618539e-03 6.880838e-04
#> 17 1.106891e-03 9.369255e-04 6.659090e-04 3.831847e-04 1.629020e-04
#>              10
#> 0  2.222022e-08
#> 1  2.618886e-07
#> 2  1.596274e-06
#> 3  6.678339e-06
#> 4  2.147600e-05
#> 5  5.635445e-05
#> 6  1.250624e-04
#> 7  2.400870e-04
#> 8  4.044410e-04
#> 9  6.027890e-04
#> 10 7.974001e-04
#> 11 9.345209e-04
#> 12 9.628544e-04
#> 13 8.585614e-04
#> 14 6.440328e-04
#> 15 3.859720e-04
#> 16 1.665729e-04
#> 17 3.943569e-05
#> 
#> $posterior
#>            0         1         2         3         4          5          6
#> 0  0.6457965 0.5043094 0.3651517 0.2431677 0.1476992 0.08110101 0.03987006
#> 1  0.7135928 0.5792353 0.4377537 0.3052261 0.1945689 0.11232248 0.05813197
#> 2  0.7737201 0.6504532 0.5115653 0.3726003 0.2488362 0.15083508 0.08211150
#> 3  0.8254462 0.7160685 0.5842682 0.4434471 0.3096884 0.19684673 0.11261382
#> 4  0.8686390 0.7747145 0.6537144 0.5156829 0.3758536 0.25015824 0.15025315
#> 5  0.9036583 0.8255868 0.7180820 0.5871489 0.4456705 0.31011999 0.19535854
#> 6  0.9312233 0.8684185 0.7759850 0.6557786 0.5171979 0.37562651 0.24788752
#> 7  0.9522790 0.9034100 0.8265305 0.7197491 0.5883541 0.44515337 0.30735870
#> 8  0.9678738 0.9311288 0.8693242 0.7776032 0.6570721 0.51683748 0.37281469
#> 9  0.9790591 0.9523975 0.9044312 0.8283298 0.7214545 0.58859661 0.44282578
#> 10 0.9868156 0.9681811 0.9323017 0.8713997 0.7799143 0.65828017 0.51554263
#> 11 0.9920049 0.9794879 0.9536747 0.9067547 0.8312844 0.72383795 0.58880205
#> 12 0.9953458 0.9872879 0.9694724 0.9347562 0.8748876 0.78348954 0.66028319
#> 13 0.9974092 0.9924545 0.9806963 0.9560996 0.9105547 0.83587389 0.72770254
#> 14 0.9986272 0.9957292 0.9883366 0.9717091 0.9385924 0.88015758 0.78902615
#> 15 0.9993113 0.9977070 0.9933002 0.9826229 0.9597021 0.91608383 0.84266865
#> 16 0.9996751 0.9988396 0.9963635 0.9898862 0.9748636 0.94395193 0.88764499
#> 17 0.9998571 0.9994509 0.9981492 0.9944633 0.9852008 0.96452927 0.92364526
#>             7           8           9          10
#> 0  0.01736271 0.006618234 0.002177223 0.000607244
#> 1  0.02667879 0.010725890 0.003724229 0.001096971
#> 2  0.03969225 0.016826936 0.006166495 0.001918517
#> 3  0.05730728 0.025611584 0.009906077 0.003256013
#> 4  0.08044761 0.037893387 0.015469363 0.005373039
#> 5  0.10998402 0.054587720 0.023521522 0.008635660
#> 6  0.14664492 0.076670094 0.034871902 0.013536838
#> 7  0.19091479 0.105110987 0.050464634 0.020719214
#> 8  0.24292922 0.140785835 0.071347837 0.030991457
#> 9  0.30237821 0.184362228 0.098614756 0.045331274
#> 10 0.36843341 0.236171360 0.133311822 0.064866287
#> 11 0.43971666 0.296077326 0.176312572 0.090823018
#> 12 0.51432748 0.363364908 0.228163365 0.124435430
#> 13 0.58994191 0.436672070 0.288916500 0.166808911
#> 14 0.66398553 0.513994529 0.357976944 0.218744065
#> 15 0.73386808 0.592783481 0.433997101 0.280536434
#> 16 0.79724995 0.670142387 0.514855598 0.351780895
#> 17 0.85229689 0.743106809 0.597747462 0.431218910
#> 
#> $success
#>        0     1     2     3     4     5     6     7     8     9    10
#> 0  FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 1  FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 2  FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 3  FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 4  FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 5   TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 6   TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 7   TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 8   TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 9   TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 10  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 11  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 12  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 13  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> 14  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> 15  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE
#> 16  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE
#> 17  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE
#>