Skip to contents

[Experimental]

Usage

ocPostprobDist(
  nnE,
  truep,
  deltaE,
  deltaF,
  relativeDelta = FALSE,
  tL,
  tU,
  parE = c(a = 1, b = 1),
  parS = c(a = 1, b = 1),
  wiggle = TRUE,
  sim = 50000,
  nnF = nnE
)

Arguments

nnE

(numeric):
sample size or sizes where study can be stopped for Efficacy decision. If different for Futility decision, specify in nnF.

truep

(number):
assumed true response rate.

deltaE

(number):
margin of which the response rate in the treatment group should be better than in the standard of care of group. Delta for Efficacy is used to calculate P(truep > P_S + deltaE) which should exceed threshold tU to to stop for Efficacy. DeltaE can also be negative in non-inferiority setting. See also note.

deltaF

(number):
margin of which the response rate in the treatment group should be better than in the standard of care of group. Delta for Futility is used to calculate P(truep > P_S - deltaF) which should exceed threshold tL to stop for Futility.DeltaF can also be negative in non-inferiority setting. See also note.

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 is included as the margin between treatment and control group. See note.

tL

(number):
posterior probability threshold for being below p0.

tU

(number):
posterior probability threshold for being above p1.

parE

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

parS

(numeric or matrix):
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. See details.

wiggle

(flag):
generate random look locations (not default). if TRUE, optional to specify dist (see @details).

sim

(number):
number of simulations.

nnF

(numeric):
sample size or sizes where study can be stopped for Futility decision if different from Efficacy decision.

Details

The trial is stopped for Efficacy if the posterior probability of assumed true response rate or truep is better than the control arm by at least deltaE, is larger than tU. Analogously, The trial is stopped for Efficacy if the posterior probability of assumed true response rate or truep is better than the control arm by at least deltaF, is larger than tL for Futility looks. If these criteria are not met, the trial is continued and at the maximum sample size, it may reach no decision or "gray zone".The following represents the stopping criteria for Efficacy and Futility respectively.

Stop criteria for Efficacy :

Pr(truep > P_S + deltaE) > tU

Stop criteria for Futility :

Pr(truep < P_S + deltaF) > tL

Where truep is the assumed true rate of response and p1 and p0 respectively are the thresholds for Efficacy and Futility respectively.

Resulting operating characteristics include the following:

  • 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

Note

Delta :

The desired improvement is denoted as deltaE or deltaF and two options exist in its use: The absolute case when relativeDelta = FALSE and relative as when relativeDelta = TRUE.

  1. The absolute case is when we define an absolute delta, greater than P_S, the response rate of the standard of care or control or S group such that the posterior is Pr(truep > P_S + deltaE | data) for Efficacy looks or Pr(truep > P_S + deltaF | data) for Futility looks.

  2. In the relative case, we suppose that the treatment group's response rate is assumed to be greater than P_S + (1-P_S) * delta such that the posterior is Pr(truep > P_S + (1 - P_S) * deltaE | data) for Efficacy looks or Pr(truep > P_S + (1 - P_S) * deltaF | data) for Futility looks.

Examples

# operating characteristics for posterior probability method with beta prior on SOC
# For three looks of 10, 20 and 30 we have the following assumptions :
# True response rate or truep of the treatment group = 40%
# The following are the Go and Stop rules respectively :
# Prior of treatment arm parE= Beta(1,1).
# stop for efficacy (deltaE): Pr(truep > P_S + deltaE) > tU
# stop for futility (deltaF): Pr(truep < P_S + deltaF) > tL
# Without random distance allowed for Futility and Efficacy Looks.
res1 <- ocPostprobDist(
  nnE = c(10, 20, 30),
  truep = 0.4,
  deltaE = 0.1,
  deltaF = -0.1,
  tL = 0.6,
  tU = 0.6,
  parE = c(1, 1),
  parS = c(5, 25),
  sim = 50,
  wiggle = FALSE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence

res1$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1        16        0.72          0       0.72          0       0.84       0.16

# Allow random distance for Efficacy and Futility looks.
res2 <- ocPostprobDist(
  nnE = c(10, 20, 30),
  truep = 0.4,
  deltaE = 0.1,
  deltaF = -0.1,
  tL = 0.6,
  tU = 0.6,
  parE = c(1, 1),
  parS = c(5, 25),
  sim = 50,
  wiggle = TRUE
)
#> Warning: Advise to use sim >= 50000 to achieve convergence

res2$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1     14.18         0.9       0.06       0.84       0.06       0.88       0.06

# Allow Futility analysis only at the end.
res4 <- ocPostprobDist(
  nnE = c(10, 20, 30),
  truep = 0.4,
  deltaE = 0.1,
  deltaF = -0.1,
  tL = 0.6,
  tU = 0.6,
  parE = c(1, 1),
  parS = c(5, 25),
  sim = 50,
  wiggle = TRUE,
  nnF = 30
)
#> Warning: Advise to use sim >= 50000 to achieve convergence

res4$oc
#>   ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
#> 1        30           0          0          0          0       0.82       0.18