Skip to contents

Evaluates operating characteristics (Go, NoGo, Gray probabilities) for clinical trials with two binary endpoints under the Bayesian framework. The function supports controlled, uncontrolled, and external designs, and uses both posterior probability and posterior predictive probability criteria.

Usage

pbayesdecisionprob2bin(
  nsim = 10000L,
  prob = "posterior",
  design = "controlled",
  GoRegions,
  NoGoRegions,
  gamma_go,
  gamma_nogo,
  pi_t1,
  pi_t2,
  rho_t,
  pi_c1 = NULL,
  pi_c2 = NULL,
  rho_c = NULL,
  n_t,
  n_c = NULL,
  a_t_00,
  a_t_01,
  a_t_10,
  a_t_11,
  a_c_00,
  a_c_01,
  a_c_10,
  a_c_11,
  m_t = NULL,
  m_c = NULL,
  theta_TV1 = NULL,
  theta_MAV1 = NULL,
  theta_TV2 = NULL,
  theta_MAV2 = NULL,
  theta_NULL1 = NULL,
  theta_NULL2 = NULL,
  z00 = NULL,
  z01 = NULL,
  z10 = NULL,
  z11 = NULL,
  xe_t_00 = NULL,
  xe_t_01 = NULL,
  xe_t_10 = NULL,
  xe_t_11 = NULL,
  xe_c_00 = NULL,
  xe_c_01 = NULL,
  xe_c_10 = NULL,
  xe_c_11 = NULL,
  alpha0e_t = NULL,
  alpha0e_c = NULL,
  nMC = 10000L,
  CalcMethod = "Exact",
  error_if_Miss = TRUE,
  Gray_inc_Miss = FALSE
)

Arguments

nsim

A positive integer giving the number of PoC count vectors sampled via rmultinom per arm per scenario when CalcMethod = 'MC' (outer loop). The sampled vectors are deduplicated into \(K_t\) and \(K_c\) unique vectors (\(K_t, K_c \ll\) nsim); Dirichlet sampling is then performed only for these unique vectors using nMC draws each. Ignored when CalcMethod = 'Exact'. Default is 10000.

prob

A character string specifying the probability type. Must be 'posterior' or 'predictive'.

design

A character string specifying the trial design. Must be 'controlled', 'uncontrolled', or 'external'.

GoRegions

An integer vector specifying which of the nine posterior regions (R1–R9) or four predictive regions (R1–R4) constitute a Go decision. For prob = 'posterior', valid values are integers in 1–9; for prob = 'predictive', in 1–4. A common choice is GoRegions = 1 (both endpoints exceed TV or NULL for posterior/predictive, respectively).

NoGoRegions

An integer vector specifying which regions constitute a NoGo decision. A common choice is NoGoRegions = 9 (both endpoints below MAV) for posterior, or NoGoRegions = 4 for predictive. Must be disjoint from GoRegions.

gamma_go

A numeric scalar in (0, 1). Go threshold: a Go decision is made if \(P(\mathrm{GoRegions}) \ge \gamma_1\).

gamma_nogo

A numeric scalar in (0, 1). NoGo threshold: a NoGo decision is made if \(P(\mathrm{NoGoRegions}) \ge \gamma_2\). No ordering constraint on gamma_go and gamma_nogo is imposed; their combination determines the frequency of Miss outcomes.

pi_t1

A numeric vector of true treatment response probabilities for Endpoint 1. Each element must be in (0, 1).

pi_t2

A numeric vector of true treatment response probabilities for Endpoint 2. Must have the same length as pi_t1.

rho_t

A numeric vector of true within-treatment-arm correlations between Endpoint 1 and Endpoint 2. Must have the same length as pi_t1. If any element is outside the feasible range for the corresponding (pi_t1, pi_t2) pair, that scenario returns NA for all decision probabilities instead of stopping with an error.

pi_c1

A numeric vector of true control response probabilities for Endpoint 1. For design = 'uncontrolled', this parameter is not used in probability calculations but must still be supplied; it is retained in the output for reference. Must have the same length as pi_t1.

pi_c2

A numeric vector of true control response probabilities for Endpoint 2. For design = 'uncontrolled', see note for pi_c1. Must have the same length as pi_t1.

rho_c

A numeric vector of true within-control-arm correlations. For design = 'uncontrolled', not used in probability calculations. Must have the same length as pi_t1. If any element is outside the feasible range for the corresponding (pi_c1, pi_c2) pair, that scenario returns NA for all decision probabilities.

n_t

A positive integer giving the number of patients in the treatment group in the proof-of-concept (PoC) trial.

n_c

A positive integer giving the number of patients in the control group in the PoC trial. For design = 'uncontrolled', this is the hypothetical control sample size (required for consistency with other designs).

a_t_00

A positive numeric scalar giving the Dirichlet prior parameter for the (0, 0) response pattern in the treatment group.

a_t_01

A positive numeric scalar giving the Dirichlet prior parameter for the (0, 1) response pattern in the treatment group.

a_t_10

A positive numeric scalar giving the Dirichlet prior parameter for the (1, 0) response pattern in the treatment group.

a_t_11

A positive numeric scalar giving the Dirichlet prior parameter for the (1, 1) response pattern in the treatment group.

a_c_00

A positive numeric scalar giving the Dirichlet prior parameter for the (0, 0) response pattern in the control group. For design = 'uncontrolled', serves as a hyperparameter of the hypothetical control distribution.

a_c_01

A positive numeric scalar giving the Dirichlet prior parameter for the (0, 1) response pattern in the control group. For design = 'uncontrolled', serves as a hyperparameter of the hypothetical control distribution.

a_c_10

A positive numeric scalar giving the Dirichlet prior parameter for the (1, 0) response pattern in the control group. For design = 'uncontrolled', serves as a hyperparameter of the hypothetical control distribution.

a_c_11

A positive numeric scalar giving the Dirichlet prior parameter for the (1, 1) response pattern in the control group. For design = 'uncontrolled', serves as a hyperparameter of the hypothetical control distribution.

m_t

A positive integer giving the number of patients in the treatment group for the future trial. Required when prob = 'predictive'; otherwise set to NULL.

m_c

A positive integer giving the number of patients in the control group for the future trial. Required when prob = 'predictive'; otherwise set to NULL.

theta_TV1

A numeric scalar giving the target value (TV) threshold for Endpoint 1. Required when prob = 'posterior'; must satisfy theta_TV1 > theta_MAV1. Set to NULL when prob = 'predictive'.

theta_MAV1

A numeric scalar giving the minimum acceptable value (MAV) threshold for Endpoint 1. Required when prob = 'posterior'; must satisfy theta_TV1 > theta_MAV1. Set to NULL when prob = 'predictive'.

theta_TV2

A numeric scalar giving the target value (TV) threshold for Endpoint 2. Required when prob = 'posterior'; must satisfy theta_TV2 > theta_MAV2. Set to NULL when prob = 'predictive'.

theta_MAV2

A numeric scalar giving the minimum acceptable value (MAV) threshold for Endpoint 2. Required when prob = 'posterior'; must satisfy theta_TV2 > theta_MAV2. Set to NULL when prob = 'predictive'.

theta_NULL1

A numeric scalar giving the null hypothesis threshold for Endpoint 1. Required when prob = 'predictive'; set to NULL when prob = 'posterior'.

theta_NULL2

A numeric scalar giving the null hypothesis threshold for Endpoint 2. Required when prob = 'predictive'; set to NULL when prob = 'posterior'.

z00

A non-negative integer giving the hypothetical control count for pattern (0, 0). Required when design = 'uncontrolled'; otherwise set to NULL.

z01

A non-negative integer giving the hypothetical control count for pattern (0, 1). Required when design = 'uncontrolled'; otherwise set to NULL.

z10

A non-negative integer giving the hypothetical control count for pattern (1, 0). Required when design = 'uncontrolled'; otherwise set to NULL.

z11

A non-negative integer giving the hypothetical control count for pattern (1, 1). Required when design = 'uncontrolled'; otherwise set to NULL.

xe_t_00

A non-negative integer giving the external treatment group count for pattern (0, 0). Required when design = 'external' and external treatment data are used; otherwise NULL.

xe_t_01

A non-negative integer giving the external treatment group count for pattern (0, 1). Required for external treatment data; otherwise NULL.

xe_t_10

A non-negative integer giving the external treatment group count for pattern (1, 0). Required for external treatment data; otherwise NULL.

xe_t_11

A non-negative integer giving the external treatment group count for pattern (1, 1). Required for external treatment data; otherwise NULL.

xe_c_00

A non-negative integer giving the external control group count for pattern (0, 0). Required when design = 'external' and external control data are used; otherwise NULL.

xe_c_01

A non-negative integer giving the external control group count for pattern (0, 1). Required for external control data; otherwise NULL.

xe_c_10

A non-negative integer giving the external control group count for pattern (1, 0). Required for external control data; otherwise NULL.

xe_c_11

A non-negative integer giving the external control group count for pattern (1, 1). Required for external control data; otherwise NULL.

alpha0e_t

A numeric scalar in (0, 1] giving the power prior weight for the treatment group. Required when external treatment data are used; otherwise NULL.

alpha0e_c

A numeric scalar in (0, 1] giving the power prior weight for the control group. Required when external control data are used; otherwise NULL.

nMC

A positive integer giving the number of Dirichlet draws used to evaluate the decision probability for each count combination in Stage 1. Used by both CalcMethod = 'Exact' and CalcMethod = 'MC' (inner loop). Default is 10000.

CalcMethod

A character string specifying the computation method. Must be 'Exact' (default) or 'MC'. 'Exact' uses full enumeration of all possible multinomial count combinations (two-stage approach described in Details). 'MC' samples nsim \((x_t, x_c)\) pairs via rmultinom, deduplicates them into \(K\) unique pairs (\(K \ll\) nsim), calls pbayespostpred2bin for each unique pair to obtain Go/NoGo probabilities, and weights the decisions by the observed pair frequencies. This reuses the same validated probability logic as the Exact method, avoiding any duplication of computation. The 'MC' method trades some Monte Carlo variance for substantially reduced computation time when n_t and/or n_c are large.

error_if_Miss

A logical scalar; if TRUE (default), the function stops with an error if the Miss probability is positive, prompting reconsideration of the thresholds.

Gray_inc_Miss

A logical scalar; if TRUE, the Miss probability is added to Gray. If FALSE (default), Miss is reported separately. Active only when error_if_Miss = FALSE.

Value

A data frame with one row per scenario and columns:

pi_t1

True treatment response probability for Endpoint 1.

pi_t2

True treatment response probability for Endpoint 2.

rho_t

True within-arm correlation in the treatment arm.

pi_c1

True control response probability for Endpoint 1 (omitted when design = 'uncontrolled').

pi_c2

True control response probability for Endpoint 2 (omitted when design = 'uncontrolled').

rho_c

True within-arm correlation in the control arm (omitted when design = 'uncontrolled').

Go

Probability of making a Go decision.

Gray

Probability of making a Gray (inconclusive) decision.

NoGo

Probability of making a NoGo decision.

Miss

Probability where Go and NoGo criteria are simultaneously met. Included when error_if_Miss = FALSE and Gray_inc_Miss = FALSE.

The returned object has S3 class pbayesdecisionprob2bin with an associated print method.

Details

Computation proceeds in two stages for efficiency. In Stage 1, posterior or predictive probabilities are precomputed for every possible multinomial count combination \((x_t, x_c)\). In Stage 2, operating characteristics for each scenario are obtained by weighting the Stage 1 decisions by their multinomial probabilities under the true parameters, avoiding repeated Monte Carlo sampling per scenario.

Two-stage computation.

Stage 1 (precomputation): All possible multinomial count combinations \(x_t\) are enumerated using allmultinom. For design = 'controlled' or 'external', all combinations \(x_c\) are also enumerated and the Go/NoGo probability matrix PrGo[i, j] has dimensions \(n_t \times n_c\). For design = 'uncontrolled', the control distribution is fixed as \(\mathrm{Dir}(\alpha_{2,**} + z_{**})\) and does not depend on any observed control counts; the probability matrix therefore has dimensions \(n_t \times 1\), eliminating the \(\binom{n_2+3}{3}\)-row control enumeration and the associated Gamma sampling. This stage is independent of the true scenario parameters.

Stage 2 (scenario evaluation): For each scenario \((\pi_{t1}, \pi_{t2}, \rho_t, \pi_{c1}, \pi_{c2}, \rho_c)\), getjointbin converts the marginal rates and correlation into the four-cell probability vector \(p_k\). The multinomial probability mass function weights the Stage 1 decisions: $$\Pr(\mathrm{Go} \mid \Theta) = \sum_{i,j} \mathbf{1}(\mathrm{Go}_{ij}) \cdot P(x_{t,i} \mid n_1, p_t) \cdot P(x_{c,j} \mid n_2, p_c),$$ where \(\mathbf{1}(\mathrm{Go}_{ij})\) is the Go indicator from Stage 1. Stage 2 requires no additional Monte Carlo and is fast even for large scenario grids.

Decision categories.

  • Go: sum of Go region probabilities \(\ge \gamma_1\) AND sum of NoGo region probabilities \(< \gamma_2\).

  • NoGo: sum of Go region probabilities \(< \gamma_1\) AND sum of NoGo region probabilities \(\ge \gamma_2\).

  • Miss: both Go and NoGo criteria satisfied simultaneously.

  • Gray: neither Go nor NoGo criterion satisfied.

Examples


# Example 1: Posterior probability, controlled design (rho > 0)
# Explores the impact of positive within-arm endpoint correlation.
pbayesdecisionprob2bin(
  prob        = 'posterior',
  design      = 'controlled',
  GoRegions   = 1L,
  NoGoRegions = 9L,
  gamma_go    = 0.52,
  gamma_nogo  = 0.52,
  pi_t1       = c(0.15, 0.25, 0.30, 0.40),
  pi_t2       = c(0.20, 0.30, 0.35, 0.45),
  rho_t       = rep(0.6, 4),
  pi_c1       = rep(0.15, 4),
  pi_c2       = rep(0.20, 4),
  rho_c       = rep(0.6, 4),
  n_t = 10, n_c = 10,
  a_t_00 = 0.25, a_t_01 = 0.25, a_t_10 = 0.25, a_t_11 = 0.25,
  a_c_00 = 0.25, a_c_01 = 0.25, a_c_10 = 0.25, a_c_11 = 0.25,
  m_t = NULL, m_c = NULL,
  theta_TV1   = 0.15, theta_MAV1 = 0.10,
  theta_TV2   = 0.15, theta_MAV2 = 0.10,
  theta_NULL1 = NULL, theta_NULL2 = NULL,
  z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL,
  xe_t_00 = NULL, xe_t_01 = NULL, xe_t_10 = NULL, xe_t_11 = NULL,
  xe_c_00 = NULL, xe_c_01 = NULL, xe_c_10 = NULL, xe_c_11 = NULL,
  alpha0e_t = NULL, alpha0e_c = NULL,
  nMC = 100,
  error_if_Miss = FALSE, Gray_inc_Miss = FALSE
)
#> Go/NoGo/Gray Decision Probabilities (Two Binary Endpoints) 
#> ----------------------------------------------------------------------------- 
#>   Probability type : posterior 
#>   Design           : controlled 
#>   Threshold(s)     : TV1 = 0.15, MAV1 = 0.1 
#>                      TV2 = 0.15, MAV2 = 0.1 
#>   Go  threshold    : gamma_go = 0.52 
#>   NoGo threshold   : gamma_nogo = 0.52 
#>   Go  regions      : {1} 
#>   NoGo regions     : {9} 
#>   Sample size      : n_t = 10, n_c = 10 
#>   Prior (treatment): a_t = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Prior (control)  : a_c = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Method           : Exact 
#>   MC draws         : nMC = 100 
#>   Miss handling    : error_if_Miss = FALSE, Gray_inc_Miss = FALSE 
#> ----------------------------------------------------------------------------- 
#>  pi_t1 pi_t2 rho_t pi_c1 pi_c2 rho_c     Go   Gray   NoGo   Miss
#>   0.15  0.20   0.6  0.15   0.2   0.6 0.0476 0.3675 0.5849 0.0000
#>   0.25  0.30   0.6  0.15   0.2   0.6 0.1624 0.5164 0.3211 0.0000
#>   0.30  0.35   0.6  0.15   0.2   0.6 0.2477 0.5290 0.2233 0.0000
#>   0.40  0.45   0.6  0.15   0.2   0.6 0.4550 0.4501 0.0948 0.0000
#> ----------------------------------------------------------------------------- 

# Example 2: Posterior probability, uncontrolled design
# Hypothetical control specified via pseudo-counts.
pbayesdecisionprob2bin(
  prob        = 'posterior',
  design      = 'uncontrolled',
  GoRegions   = 1L,
  NoGoRegions = 9L,
  gamma_go    = 0.27,
  gamma_nogo  = 0.36,
  pi_t1       = c(0.15, 0.30, 0.40),
  pi_t2       = c(0.20, 0.35, 0.45),
  rho_t       = rep(0.2, 3),
  pi_c1       = NULL,
  pi_c2       = NULL,
  rho_c       = NULL,
  n_t = 10, n_c = NULL,
  a_t_00 = 0.25, a_t_01 = 0.25, a_t_10 = 0.25, a_t_11 = 0.25,
  a_c_00 = 0.25, a_c_01 = 0.25, a_c_10 = 0.25, a_c_11 = 0.25,
  m_t = NULL, m_c = NULL,
  theta_TV1   = 0.15, theta_MAV1 = 0.10,
  theta_TV2   = 0.15, theta_MAV2 = 0.10,
  theta_NULL1 = NULL, theta_NULL2 = NULL,
  z00 = 2L, z01 = 1L, z10 = 2L, z11 = 1L,
  xe_t_00 = NULL, xe_t_01 = NULL, xe_t_10 = NULL, xe_t_11 = NULL,
  xe_c_00 = NULL, xe_c_01 = NULL, xe_c_10 = NULL, xe_c_11 = NULL,
  alpha0e_t = NULL, alpha0e_c = NULL,
  nMC = 100,
  error_if_Miss = FALSE, Gray_inc_Miss = FALSE
)
#> Go/NoGo/Gray Decision Probabilities (Two Binary Endpoints) 
#> ----------------------------------------------------------------------------- 
#>   Probability type : posterior 
#>   Design           : uncontrolled 
#>   Threshold(s)     : TV1 = 0.15, MAV1 = 0.1 
#>                      TV2 = 0.15, MAV2 = 0.1 
#>   Go  threshold    : gamma_go = 0.27 
#>   NoGo threshold   : gamma_nogo = 0.36 
#>   Go  regions      : {1} 
#>   NoGo regions     : {9} 
#>   Sample size      : n_t = 10, n_c = NULL 
#>   Prior (treatment): a_t = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Prior (control)  : a_c = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Hyp. control     : z = (2, 1, 2, 1)  [z00, z01, z10, z11] 
#>   Method           : Exact 
#>   MC draws         : nMC = 100 
#>   Miss handling    : error_if_Miss = FALSE, Gray_inc_Miss = FALSE 
#> ----------------------------------------------------------------------------- 
#>  pi_t1 pi_t2 rho_t     Go   Gray   NoGo   Miss
#>   0.15  0.20   0.2 0.0001 0.0098 0.9901 0.0000
#>   0.30  0.35   0.2 0.0155 0.1588 0.8258 0.0000
#>   0.40  0.45   0.2 0.0943 0.3556 0.5501 0.0000
#> ----------------------------------------------------------------------------- 

# Example 3: Posterior probability, external control design
# External control data incorporated via power prior (alpha0e_c = 0.5).
pbayesdecisionprob2bin(
  prob        = 'posterior',
  design      = 'external',
  GoRegions   = 1L,
  NoGoRegions = 9L,
  gamma_go    = 0.27,
  gamma_nogo  = 0.36,
  pi_t1       = c(0.15, 0.25, 0.30, 0.40),
  pi_t2       = c(0.20, 0.30, 0.35, 0.45),
  rho_t       = rep(0.0, 4),
  pi_c1       = rep(0.15, 4),
  pi_c2       = rep(0.20, 4),
  rho_c       = rep(0.0, 4),
  n_t = 10, n_c = 10,
  a_t_00 = 0.25, a_t_01 = 0.25, a_t_10 = 0.25, a_t_11 = 0.25,
  a_c_00 = 0.25, a_c_01 = 0.25, a_c_10 = 0.25, a_c_11 = 0.25,
  m_t = NULL, m_c = NULL,
  theta_TV1   = 0.15, theta_MAV1 = 0.10,
  theta_TV2   = 0.15, theta_MAV2 = 0.10,
  theta_NULL1 = NULL, theta_NULL2 = NULL,
  z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL,
  xe_t_00 = NULL, xe_t_01 = NULL, xe_t_10 = NULL, xe_t_11 = NULL,
  xe_c_00 = 4L,  xe_c_01 = 2L,  xe_c_10 = 3L,  xe_c_11 = 1L,
  alpha0e_t = NULL, alpha0e_c = 0.5,
  nMC = 100,
  error_if_Miss = FALSE, Gray_inc_Miss = FALSE
)
#> Go/NoGo/Gray Decision Probabilities (Two Binary Endpoints) 
#> ---------------------------------------------------------------------------------- 
#>   Probability type : posterior 
#>   Design           : external 
#>   Threshold(s)     : TV1 = 0.15, MAV1 = 0.1 
#>                      TV2 = 0.15, MAV2 = 0.1 
#>   Go  threshold    : gamma_go = 0.27 
#>   NoGo threshold   : gamma_nogo = 0.36 
#>   Go  regions      : {1} 
#>   NoGo regions     : {9} 
#>   Sample size      : n_t = 10, n_c = 10 
#>   Prior (treatment): a_t = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Prior (control)  : a_c = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   External (treat.): xe_t = (NULL, NULL, NULL, NULL)  [xe_00, xe_01, xe_10, xe_11] 
#>   External (cont.) : xe_c = (4, 2, 3, 1)  [xe_00, xe_01, xe_10, xe_11] 
#>   Power prior      : alpha0e_t = NULL, alpha0e_c = 0.5 
#>   Method           : Exact 
#>   MC draws         : nMC = 100 
#>   Miss handling    : error_if_Miss = FALSE, Gray_inc_Miss = FALSE 
#> ---------------------------------------------------------------------------------- 
#>  pi_t1 pi_t2 rho_t pi_c1 pi_c2 rho_c     Go   Gray   NoGo   Miss
#>   0.15  0.20     0  0.15   0.2     0 0.0115 0.2063 0.7822 0.0000
#>   0.25  0.30     0  0.15   0.2     0 0.1018 0.4529 0.4453 0.0000
#>   0.30  0.35     0  0.15   0.2     0 0.2001 0.5065 0.2934 0.0000
#>   0.40  0.45     0  0.15   0.2     0 0.4793 0.4252 0.0956 0.0000
#> ---------------------------------------------------------------------------------- 

# Example 4: Predictive probability, controlled design
# Future trial has m_t = m_c = 30 patients per arm.
pbayesdecisionprob2bin(
  prob        = 'predictive',
  design      = 'controlled',
  GoRegions   = 1L,
  NoGoRegions = 4L,
  gamma_go    = 0.60,
  gamma_nogo  = 0.80,
  pi_t1       = c(0.15, 0.25, 0.30, 0.40),
  pi_t2       = c(0.20, 0.30, 0.35, 0.45),
  rho_t       = rep(0.3, 4),
  pi_c1       = rep(0.15, 4),
  pi_c2       = rep(0.20, 4),
  rho_c       = rep(0.3, 4),
  n_t = 10, n_c = 10,
  a_t_00 = 0.25, a_t_01 = 0.25, a_t_10 = 0.25, a_t_11 = 0.25,
  a_c_00 = 0.25, a_c_01 = 0.25, a_c_10 = 0.25, a_c_11 = 0.25,
  m_t = 30L, m_c = 30L,
  theta_TV1   = NULL, theta_MAV1 = NULL,
  theta_TV2   = NULL, theta_MAV2 = NULL,
  theta_NULL1 = 0.10, theta_NULL2 = 0.10,
  z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL,
  xe_t_00 = NULL, xe_t_01 = NULL, xe_t_10 = NULL, xe_t_11 = NULL,
  xe_c_00 = NULL, xe_c_01 = NULL, xe_c_10 = NULL, xe_c_11 = NULL,
  alpha0e_t = NULL, alpha0e_c = NULL,
  nMC = 100,
  error_if_Miss = FALSE, Gray_inc_Miss = FALSE
)
#> Go/NoGo/Gray Decision Probabilities (Two Binary Endpoints) 
#> ----------------------------------------------------------------------------- 
#>   Probability type : predictive 
#>   Design           : controlled 
#>   Threshold(s)     : NULL1 = 0.1, NULL2 = 0.1 
#>   Go  threshold    : gamma_go = 0.6 
#>   NoGo threshold   : gamma_nogo = 0.8 
#>   Go  regions      : {1} 
#>   NoGo regions     : {4} 
#>   Sample size      : n_t = 10, n_c = 10 
#>   Prior (treatment): a_t = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Prior (control)  : a_c = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Future trial     : m_t = 30, m_c = 30 
#>   Method           : Exact 
#>   MC draws         : nMC = 100 
#>   Miss handling    : error_if_Miss = FALSE, Gray_inc_Miss = FALSE 
#> ----------------------------------------------------------------------------- 
#>  pi_t1 pi_t2 rho_t pi_c1 pi_c2 rho_c     Go   Gray   NoGo   Miss
#>   0.15  0.20   0.3  0.15   0.2   0.3 0.0217 0.7849 0.1935 0.0000
#>   0.25  0.30   0.3  0.15   0.2   0.3 0.0993 0.8475 0.0532 0.0000
#>   0.30  0.35   0.3  0.15   0.2   0.3 0.1679 0.8062 0.0259 0.0000
#>   0.40  0.45   0.3  0.15   0.2   0.3 0.3600 0.6348 0.0052 0.0000
#> ----------------------------------------------------------------------------- 

# Example 5: Predictive probability, uncontrolled design
# Hypothetical control specified via pseudo-counts; future trial m_t = m_c = 30.
pbayesdecisionprob2bin(
  prob        = 'predictive',
  design      = 'uncontrolled',
  GoRegions   = 1L,
  NoGoRegions = 4L,
  gamma_go    = 0.60,
  gamma_nogo  = 0.80,
  pi_t1       = c(0.15, 0.30, 0.40),
  pi_t2       = c(0.20, 0.35, 0.45),
  rho_t       = rep(0.7, 3),
  pi_c1       = rep(0.15, 3),
  pi_c2       = rep(0.20, 3),
  rho_c       = rep(0.7, 3),
  n_t = 10, n_c = 10,
  a_t_00 = 0.25, a_t_01 = 0.25, a_t_10 = 0.25, a_t_11 = 0.25,
  a_c_00 = 0.25, a_c_01 = 0.25, a_c_10 = 0.25, a_c_11 = 0.25,
  m_t = 30L, m_c = 30L,
  theta_TV1   = NULL, theta_MAV1 = NULL,
  theta_TV2   = NULL, theta_MAV2 = NULL,
  theta_NULL1 = 0.10, theta_NULL2 = 0.10,
  z00 = 2L, z01 = 1L, z10 = 2L, z11 = 1L,
  xe_t_00 = NULL, xe_t_01 = NULL, xe_t_10 = NULL, xe_t_11 = NULL,
  xe_c_00 = NULL, xe_c_01 = NULL, xe_c_10 = NULL, xe_c_11 = NULL,
  alpha0e_t = NULL, alpha0e_c = NULL,
  nMC = 100,
  error_if_Miss = FALSE, Gray_inc_Miss = FALSE
)
#> Go/NoGo/Gray Decision Probabilities (Two Binary Endpoints) 
#> ----------------------------------------------------------------------------- 
#>   Probability type : predictive 
#>   Design           : uncontrolled 
#>   Threshold(s)     : NULL1 = 0.1, NULL2 = 0.1 
#>   Go  threshold    : gamma_go = 0.6 
#>   NoGo threshold   : gamma_nogo = 0.8 
#>   Go  regions      : {1} 
#>   NoGo regions     : {4} 
#>   Sample size      : n_t = 10, n_c = 10 
#>   Prior (treatment): a_t = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Prior (control)  : a_c = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Hyp. control     : z = (2, 1, 2, 1)  [z00, z01, z10, z11] 
#>   Future trial     : m_t = 30, m_c = 30 
#>   Method           : Exact 
#>   MC draws         : nMC = 100 
#>   Miss handling    : error_if_Miss = FALSE, Gray_inc_Miss = FALSE 
#> ----------------------------------------------------------------------------- 
#>  pi_t1 pi_t2 rho_t     Go   Gray   NoGo   Miss
#>   0.15  0.20   0.7 0.0000 0.3502 0.6498 0.0000
#>   0.30  0.35   0.7 0.0014 0.7758 0.2228 0.0000
#>   0.40  0.45   0.7 0.0119 0.9110 0.0771 0.0000
#> ----------------------------------------------------------------------------- 

# Example 6: Predictive probability, external treatment design
# External treatment data incorporated via power prior (alpha0e_t = 0.5).
pbayesdecisionprob2bin(
  prob        = 'predictive',
  design      = 'external',
  GoRegions   = 1L,
  NoGoRegions = 4L,
  gamma_go    = 0.60,
  gamma_nogo  = 0.80,
  pi_t1       = c(0.15, 0.25, 0.30, 0.40),
  pi_t2       = c(0.20, 0.30, 0.35, 0.45),
  rho_t       = rep(0.5, 4),
  pi_c1       = rep(0.15, 4),
  pi_c2       = rep(0.20, 4),
  rho_c       = rep(0.5, 4),
  n_t = 10, n_c = 10,
  a_t_00 = 0.25, a_t_01 = 0.25, a_t_10 = 0.25, a_t_11 = 0.25,
  a_c_00 = 0.25, a_c_01 = 0.25, a_c_10 = 0.25, a_c_11 = 0.25,
  m_t = 30L, m_c = 30L,
  theta_TV1   = NULL, theta_MAV1 = NULL,
  theta_TV2   = NULL, theta_MAV2 = NULL,
  theta_NULL1 = 0.10, theta_NULL2 = 0.10,
  z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL,
  xe_t_00 = 3L, xe_t_01 = 2L, xe_t_10 = 3L, xe_t_11 = 2L,
  xe_c_00 = NULL, xe_c_01 = NULL, xe_c_10 = NULL, xe_c_11 = NULL,
  alpha0e_t = 0.5, alpha0e_c = NULL,
  nMC = 100,
  error_if_Miss = FALSE, Gray_inc_Miss = FALSE
)
#> Go/NoGo/Gray Decision Probabilities (Two Binary Endpoints) 
#> ---------------------------------------------------------------------------------- 
#>   Probability type : predictive 
#>   Design           : external 
#>   Threshold(s)     : NULL1 = 0.1, NULL2 = 0.1 
#>   Go  threshold    : gamma_go = 0.6 
#>   NoGo threshold   : gamma_nogo = 0.8 
#>   Go  regions      : {1} 
#>   NoGo regions     : {4} 
#>   Sample size      : n_t = 10, n_c = 10 
#>   Prior (treatment): a_t = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Prior (control)  : a_c = (0.25, 0.25, 0.25, 0.25)  [a_00, a_01, a_10, a_11] 
#>   Future trial     : m_t = 30, m_c = 30 
#>   External (treat.): xe_t = (3, 2, 3, 2)  [xe_00, xe_01, xe_10, xe_11] 
#>   External (cont.) : xe_c = (NULL, NULL, NULL, NULL)  [xe_00, xe_01, xe_10, xe_11] 
#>   Power prior      : alpha0e_t = 0.5, alpha0e_c = NULL 
#>   Method           : Exact 
#>   MC draws         : nMC = 100 
#>   Miss handling    : error_if_Miss = FALSE, Gray_inc_Miss = FALSE 
#> ---------------------------------------------------------------------------------- 
#>  pi_t1 pi_t2 rho_t pi_c1 pi_c2 rho_c     Go   Gray   NoGo   Miss
#>   0.15  0.20   0.5  0.15   0.2   0.5 0.0845 0.8871 0.0284 0.0000
#>   0.25  0.30   0.5  0.15   0.2   0.5 0.2058 0.7838 0.0104 0.0000
#>   0.30  0.35   0.5  0.15   0.2   0.5 0.2844 0.7095 0.0061 0.0000
#>   0.40  0.45   0.5  0.15   0.2   0.5 0.4622 0.5359 0.0019 0.0000
#> ----------------------------------------------------------------------------------