Skip to contents

[Experimental]

Calculate operating characteristics for predictive probability method.

It is assumed that the true response rate is truep. Trials can stop for Futility or Efficacy. Trials can also stop at Interim or Final for Futility or Efficacy.

There are two variations of decision rule, Decision 1 and Decision 2, to evaluate decision at Interim or Final, for Futility or Efficacy. Decision 1 is used when decision1 == TRUE which is the default setting.

Decision 1:

The criteria for Decision 1 for Interim looks are :

  • interim GO = P(successful trial at final) > phiU

  • interim STOP = P(successful trial at final) < phiL

The criteria for Decision 1 for Final looks are:

  • Final GO = P( response rate > p0 | data) > tT

  • Final STOP = P( response rate > p0 | data ) < tT

Decision 2:

The criteria for Decision 2 for Interim looks are :

  • Interim GO : P ( success at final) > phiU

  • Interim STOP : P (failure at final ) > phiFu

The criteria for Decision 2 for Futility looks are :

  • Final GO = P( response rate > p0) > tT

  • Final STOP = P( response rate < p1) > tF

Usage

ocPredprob(
  nnE,
  truep,
  p0,
  phiU,
  p1 = p0,
  tT = 1 - tF,
  tF = 1 - tT,
  phiL = 1 - phiFu,
  phiFu = 1 - phiL,
  parE = c(1, 1),
  sim = 50000,
  wiggle = FALSE,
  nnF = nnE,
  decision1 = TRUE
)

Arguments

nnE

(numeric):
sample size or sizes where study can be stopped for Efficacy decision. If 0 or NULL and length(nnE) = 1 then no Efficacy looks are performed.

truep

(number):
assumed true response rate or true rate (scenario).

p0

(number):
lower Futility threshold of response rate.

phiU

(number):
upper threshold on the predictive probability.

p1

(number):
upper Futility threshold of response rate.

tT

(number):
threshold of which assumed truep exceeds acceptable threshold of p0.

tF

(number):
threshold of which assumed truep does not exceed threshold of p1.

phiL

(number):
lower threshold on the predictive probability.

phiFu

(number):
upper threshold on the predictive probability.

parE

(numeric):
alpha and beta parameters for the prior on the treatment population. Default set at alpha = 1, beta = 1, or uniform prior.

sim

(number):
number of simulations.

wiggle

(flag):
generate random look locations (not default). If wiggle = TRUE and nnE = nnF, then all wiggled looks are the same between nnE and nnF.

nnF

(numeric):
sample size or sizes where study can be stopped for Efficacy decision. If 0 or NULL and length(nnF) = 1 then no Futility looks are performed.

decision1

(flag):
Flag if decision1 = TRUE then Decision 1 rules will be used, otherwise Decision 2 rules will be used.

Value

A list with the following elements:

  • oc: matrix with operating characteristics with the following details:

    • ExpectedN: expected number of patients in the trials

    • PrStopEarly: probability to stop the trial early (before reaching the maximum sample size)

    • PrEarlyEff: probability of Early Go decision

    • PrEarlyFut: probability of for Early Stop decision

    • PrEfficacy: probability of Go decision

    • PrFutility: probability of Stop decision

    • PrGrayZone: probability between Go and Stop ,"Evaluate" or Gray decision zone

  • Decision : numeric of results with TRUE as Go decision, FALSE as Stop and NA as gray zone.

  • SampleSize : numeric of sample sizes from nnE or nnF or both.

  • wiggled_nnE : user input for nnE with random distance applied.

  • wiggled_nnF : user input for nnF with random distance applied.

  • wiggled_dist : magnitude of random distance applied in order of input looks.

  • params : all user input arguments.

Examples

# Here we illustrate an example for Decision 1 with the following assumptions :
# True response rate or truep of the treatment group = 40%
# The following are the Final Stop rules respectively :
# - Final look for Efficacy: Pr( response rate > 25% ) > 60% or P(response rate > p0) > tT
# - Final look for Futility: Pr( response rate < 25% ) < 60% or P(response rate > p0) < tT
# - Interim look for Efficacy: Pr( success at final ) > 80% or P(success at final) > phiU
# - Interim look for Futility: Pr( failure at final ) < 20% or P(success at final) < phiL
# We assume a prior of treatment arm parE = Beta(1,1), unless otherwise indicated.

# Decision 1 with no wiggle.
set.seed(20)
result <- ocPredprob(
  nnE = c(10, 20),
  truep = 0.4,
  p0 = 0.25,
  tT = 0.6,
  phiL = 0.2,
  phiU = 0.8,
  parE = c(1, 1),
  sim = 50,
  wiggle = FALSE,
  decision1 = TRUE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence
result$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1      12.6        0.74          0       0.74        0.2        0.8          0

# Decision 1 with wiggle.
result <- ocPredprob(
  nnE = c(10, 20),
  truep = 0.4,
  p0 = 0.25,
  tT = 0.6,
  phiL = 0.2,
  phiU = 0.8,
  parE = c(1, 1),
  sim = 50,
  wiggle = TRUE,
  nnF = c(10, 20),
  decision1 = TRUE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence
result$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1      13.3         0.7          0        0.7       0.22       0.78          0

# Decision 1 with separate Futility and Efficacy looks at interim and final without wiggle.
result <- ocPredprob(
  nnE = c(10, 25, 30),
  truep = 0.4,
  p0 = 0.25,
  p1 = 0.2,
  tT = 0.6,
  phiL = 0.2,
  phiU = 0.8,
  parE = c(1, 1),
  sim = 50,
  wiggle = FALSE,
  nnF = c(10, 15, 20),
  decision1 = TRUE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence
result$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1        16           1          0          1          0          1          0

# Decision 1 with separate Futility and Efficacy looks at interim and final with wiggle.
result <- ocPredprob(
  nnE = c(10, 25, 30),
  truep = 0.4,
  p0 = 0.25,
  p1 = 0.2,
  tT = 0.6,
  phiL = 0.2,
  phiU = 0.8,
  parE = c(1, 1),
  sim = 50,
  wiggle = TRUE,
  nnF = c(10, 15, 20),
  decision1 = TRUE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence
result$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1     14.82        0.96          0       0.96       0.04       0.96          0

# Here we illustrate an example for Decision 2 with the following assumptions :
# True response rate or truep of the treatment group = 60%
# The following are the Final Stop rules respectively :
# - Final look for Efficacy: Pr( response rate > 25% ) > 60% or P(response rate > p0) > tT
# - Final look for Futility: Pr( response rate < 25% ) < 60% or P(response rate < p1) > tF
# - Interim look for Efficacy: Pr( success at final ) > 80% or P(success at final) > phiU
# - Interim look for Futility: Pr( failure at final ) > 80% or P(failure at final) > phiFu
# We assume a prior of treatment arm parE = Beta(1,1), unless otherwise indicated.

# Decision 2 without wiggle.
result <- ocPredprob(
  nnE = c(10, 20),
  truep = 0.6,
  p0 = 0.25,
  p1 = 0.25,
  tT = 0.6,
  tF = 0.6,
  phiU = 0.8,
  phiFu = 0.8,
  parE = c(1, 1),
  sim = 50,
  wiggle = FALSE,
  nnF = c(10, 20),
  decision1 = FALSE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence
result$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1        10           1       0.98       0.02       0.98       0.02          0

# Decision 2 with wiggle and with Futility only at final with non-uniform beta prior parE.
result <- ocPredprob(
  nnE = c(10, 25, 30),
  truep = 0.6,
  p0 = 0.25,
  p1 = 0.25,
  tT = 0.6,
  tF = 0.6,
  phiL = 0.8,
  phiU = 0.8,
  parE = c(11, 19),
  sim = 50,
  wiggle = TRUE,
  nnF = 30,
  decision1 = FALSE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence
result$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1      9.96           1          1          0          1          0          0