
Go/NoGo/Gray Decision Probabilities for Two Continuous Endpoints
Source:R/pbayesdecisionprob2cont.R
pbayesdecisionprob2cont.RdComputes the operating characteristics (Go, NoGo, Gray, and optionally Miss probabilities) for a two-continuous-endpoint Bayesian Go/NoGo decision framework by Monte Carlo simulation over treatment scenarios.
Usage
pbayesdecisionprob2cont(
nsim,
prob,
design,
prior,
GoRegions,
NoGoRegions,
gamma_go,
gamma_nogo,
theta_TV1 = NULL,
theta_MAV1 = NULL,
theta_TV2 = NULL,
theta_MAV2 = NULL,
theta_NULL1 = NULL,
theta_NULL2 = NULL,
n_t,
n_c = NULL,
m_t = NULL,
m_c = NULL,
mu_t,
Sigma_t,
mu_c = NULL,
Sigma_c = NULL,
kappa0_t = NULL,
nu0_t = NULL,
mu0_t = NULL,
Lambda0_t = NULL,
kappa0_c = NULL,
nu0_c = NULL,
mu0_c = NULL,
Lambda0_c = NULL,
r = NULL,
ne_t = NULL,
ne_c = NULL,
alpha0e_t = NULL,
alpha0e_c = NULL,
bar_ye_t = NULL,
bar_ye_c = NULL,
se_t = NULL,
se_c = NULL,
nMC = NULL,
CalcMethod = "MC",
error_if_Miss = TRUE,
Gray_inc_Miss = FALSE,
seed
)Arguments
- nsim
A positive integer. Number of simulated datasets per scenario.
- 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'.- prior
A character string specifying the prior distribution. Must be
'vague'or'N-Inv-Wishart'.- 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; forprob = 'predictive', in 1–4. A common choice isGoRegions = 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, orNoGoRegions = 4for predictive. Must be disjoint fromGoRegions.- 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 ongamma_goandgamma_nogois imposed; their combination determines the frequency of Miss outcomes.- theta_TV1
A numeric scalar giving the target value (TV) threshold for Endpoint 1. Required when
prob = 'posterior'; must satisfytheta_TV1 > theta_MAV1. Set toNULLwhenprob = 'predictive'.- theta_MAV1
A numeric scalar giving the minimum acceptable value (MAV) threshold for Endpoint 1. Required when
prob = 'posterior'; must satisfytheta_TV1 > theta_MAV1. Set toNULLwhenprob = 'predictive'.- theta_TV2
A numeric scalar giving the target value (TV) threshold for Endpoint 2. Required when
prob = 'posterior'; must satisfytheta_TV2 > theta_MAV2. Set toNULLwhenprob = 'predictive'.- theta_MAV2
A numeric scalar giving the minimum acceptable value (MAV) threshold for Endpoint 2. Required when
prob = 'posterior'; must satisfytheta_TV2 > theta_MAV2. Set toNULLwhenprob = 'predictive'.- theta_NULL1
A numeric scalar giving the null hypothesis threshold for Endpoint 1. Required when
prob = 'predictive'; set toNULLwhenprob = 'posterior'.- theta_NULL2
A numeric scalar giving the null hypothesis threshold for Endpoint 2. Required when
prob = 'predictive'; set toNULLwhenprob = 'posterior'.- 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).- m_t
A positive integer giving the number of patients in the treatment group for the future trial. Required when
prob = 'predictive'; otherwise set toNULL.- m_c
A positive integer giving the number of patients in the control group for the future trial. Required when
prob = 'predictive'; otherwise set toNULL.- mu_t
Numeric matrix with 2 columns. Each row gives the true treatment mean vector for one scenario. A length-2 vector is coerced to a 1-row matrix.
- Sigma_t
A 2x2 positive-definite matrix. True treatment covariance.
- mu_c
Numeric matrix with 2 columns or a length-2 vector. True control (or hypothetical control) mean vector(s).
- Sigma_c
A 2x2 positive-definite matrix. True control covariance.
- kappa0_t
A positive numeric scalar giving the NIW prior concentration parameter for the treatment group. Required when
prior = 'N-Inv-Wishart'; otherwise set toNULL.- nu0_t
A numeric scalar giving the NIW prior degrees of freedom for the treatment group. Must be greater than 3. Required when
prior = 'N-Inv-Wishart'; otherwise set toNULL.- mu0_t
A numeric vector of length 2 giving the NIW prior mean for the treatment group. Required when
prior = 'N-Inv-Wishart'; otherwise set toNULL.- Lambda0_t
A 2x2 positive-definite numeric matrix giving the NIW prior scale matrix for the treatment group. Required when
prior = 'N-Inv-Wishart'; otherwise set toNULL.- kappa0_c
A positive numeric scalar giving the NIW prior concentration parameter for the control group. Required when
prior = 'N-Inv-Wishart'anddesign != 'uncontrolled'; otherwise set toNULL.- nu0_c
A numeric scalar giving the NIW prior degrees of freedom for the control group. Must be greater than 3. Required when
prior = 'N-Inv-Wishart'anddesign != 'uncontrolled'; otherwise set toNULL.- mu0_c
A numeric vector of length 2 giving the NIW prior mean for the control group, or the hypothetical control location when
design = 'uncontrolled'. Required whenprior = 'N-Inv-Wishart'; otherwise set toNULL.- Lambda0_c
A 2x2 positive-definite numeric matrix giving the NIW prior scale matrix for the control group. Required when
prior = 'N-Inv-Wishart'anddesign != 'uncontrolled'; otherwise set toNULL.- r
A positive numeric scalar giving the variance scaling factor for the hypothetical control distribution. Required when
design = 'uncontrolled'; otherwise set toNULL.- ne_t
A positive integer giving the external treatment group sample size. Required when
design = 'external'and external treatment data are used; otherwise set toNULL.- ne_c
A positive integer giving the external control group sample size. Required when
design = 'external'and external control data are used; otherwise set toNULL.- alpha0e_t
A numeric scalar in
(0, 1]giving the power prior weight for the external treatment data. Required when external treatment data are used; otherwise set toNULL.- alpha0e_c
A numeric scalar in
(0, 1]giving the power prior weight for the external control data. Required when external control data are used; otherwise set toNULL.- bar_ye_t
A numeric vector of length 2 giving the external treatment group sample mean. Required when external treatment data are used; otherwise set to
NULL.- bar_ye_c
A numeric vector of length 2 giving the external control group sample mean. Required when external control data are used; otherwise set to
NULL.- se_t
A 2x2 numeric matrix giving the external treatment group sum-of-squares matrix. Required when external treatment data are used; otherwise set to
NULL.- se_c
A 2x2 numeric matrix giving the external control group sum-of-squares matrix. Required when external control data are used; otherwise set to
NULL.- nMC
A positive integer giving the number of Monte Carlo draws used to estimate region probabilities. Default is
10000. Required whenCalcMethod = 'MC'. May be set toNULLwhenCalcMethod = 'MM'and \(\nu_k > 4\) (the MM method usesmvtnorm::pmvtanalytically); ifCalcMethod = 'MM'but \(\nu_k \le 4\) causes a fallback to MC,nMCmust be a positive integer.- CalcMethod
A character string specifying the computation method. Must be
'MC'(Monte Carlo, default) or'MM'(Moment-Matching viamvtnorm::pmvt). WhenCalcMethod = 'MM'and \(\nu_k \le 4\), a warning is issued and the function falls back toCalcMethod = 'MC'.- error_if_Miss
Logical. If
TRUE(default), the function stops with an error when positive Miss probability is obtained. IfFALSE, Miss probability is handled according toGray_inc_Miss.- Gray_inc_Miss
Logical. If
TRUE, Miss probability is included in Gray probability. IfFALSE(default), Miss probability is reported as a separate column. Active only whenerror_if_Miss = FALSE.- seed
A single numeric value. Seed for reproducible random number generation.
Value
A data frame of class c("pbayesdecisionprob2cont", "data.frame")
with columns for the scenario parameters and Go, NoGo, Gray
(and optionally Miss) probabilities. All input parameters are
attached as attributes.
Details
The function follows the same structure as
pbayesdecisionprob1cont:
For each scenario \(s\),
nsimdatasets are simulated by generating treatment (and control) observations from \(N_2(\mu_k^{(s)}, \Sigma_k)\). To minimise overhead, raw standardised residuals are generated once (scenario- invariant) and shifted by the scenario mean.All
nsimsimulated sufficient statistics \((\bar{y}_{1,i}, S_{1,i})\) (and \((\bar{y}_{2,i}, S_{2,i})\) for controlled/external designs) are passed topbayespostpred2contin a single vectorised call, returning an \(nsim \times n_{\rm regions}\) matrix of region probabilities.Go/NoGo/Miss probabilities are obtained as the column means of indicator matrices derived from the region probability matrix.
Examples
# Example 1: Controlled design, posterior probability, vague prior
Sigma <- matrix(c(4.0, 0.8, 0.8, 1.0), 2, 2)
pbayesdecisionprob2cont(
nsim = 100L, prob = 'posterior', design = 'controlled',
prior = 'vague',
GoRegions = 1L, NoGoRegions = 9L,
gamma_go = 0.8, gamma_nogo = 0.8,
theta_TV1 = 1.5, theta_MAV1 = 0.5,
theta_TV2 = 1.0, theta_MAV2 = 0.3,
theta_NULL1 = NULL, theta_NULL2 = NULL,
n_t = 20L, n_c = 20L, m_t = NULL, m_c = NULL,
mu_t = rbind(c(1.0, 0.5), c(2.5, 1.5), c(4.0, 2.5)),
Sigma_t = Sigma,
mu_c = rbind(c(0.0, 0.0), c(0.0, 0.0), c(0.0, 0.0)),
Sigma_c = Sigma,
kappa0_t = NULL, nu0_t = NULL, mu0_t = NULL, Lambda0_t = NULL,
kappa0_c = NULL, nu0_c = NULL, mu0_c = NULL, Lambda0_c = NULL,
r = NULL,
ne_t = NULL, ne_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
bar_ye_t = NULL, bar_ye_c = NULL, se_t = NULL, se_c = NULL,
nMC = 500L, CalcMethod = 'MC',
error_if_Miss = TRUE, Gray_inc_Miss = FALSE, seed = 1L
)
#> Go/NoGo/Gray Decision Probabilities (Two Continuous Endpoints)
#> ----------------------------------------------------------------
#> Probability type : posterior
#> Design : controlled
#> Prior : vague
#> Method : NULL
#> Simulations : nsim = 100
#> MC draws : nMC = 500
#> Seed : 1
#> Threshold(s) : TV1 = 1.5, MAV1 = 0.5
#> TV2 = 1, MAV2 = 0.3
#> Go threshold : gamma_go = 0.8
#> NoGo threshold : gamma_nogo = 0.8
#> Go regions : {1}
#> NoGo regions : {9}
#> Sample size : n_t = 20, n_c = 20
#> True cov (treat.): Sigma_t = [4, 0.8; 0.8, 1]
#> True cov (cont.) : Sigma_c = [4, 0.8; 0.8, 1]
#> Miss handling : error_if_Miss = TRUE, Gray_inc_Miss = FALSE
#> ----------------------------------------------------------------
#> mu_t1 mu_t2 mu_c1 mu_c2 Go Gray NoGo
#> 1.0 0.5 0 0 0.0100 0.9800 0.0100
#> 2.5 1.5 0 0 0.5500 0.4500 0.0000
#> 4.0 2.5 0 0 1.0000 0.0000 0.0000
#> ----------------------------------------------------------------
# Example 2: Uncontrolled design, posterior probability, NIW prior
Sigma <- matrix(c(4.0, 0.8, 0.8, 1.0), 2, 2)
L0 <- matrix(c(8.0, 0.0, 0.0, 2.0), 2, 2)
pbayesdecisionprob2cont(
nsim = 100L, prob = 'posterior', design = 'uncontrolled',
prior = 'N-Inv-Wishart',
GoRegions = 1L, NoGoRegions = 9L,
gamma_go = 0.8, gamma_nogo = 0.8,
theta_TV1 = 1.5, theta_MAV1 = 0.5,
theta_TV2 = 1.0, theta_MAV2 = 0.3,
theta_NULL1 = NULL, theta_NULL2 = NULL,
n_t = 20L, n_c = NULL, m_t = NULL, m_c = NULL,
mu_t = rbind(c(1.0, 0.5), c(2.5, 1.5), c(4.0, 2.5)),
Sigma_t = Sigma,
mu_c = rbind(c(0.0, 0.0), c(0.0, 0.0), c(0.0, 0.0)),
Sigma_c = Sigma,
kappa0_t = 2.0, nu0_t = 5.0, mu0_t = c(2.0, 1.0), Lambda0_t = L0,
kappa0_c = NULL, nu0_c = NULL, mu0_c = c(0.0, 0.0), Lambda0_c = NULL,
r = 1.0,
ne_t = NULL, ne_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
bar_ye_t = NULL, bar_ye_c = NULL, se_t = NULL, se_c = NULL,
nMC = 500L, CalcMethod = 'MC',
error_if_Miss = TRUE, Gray_inc_Miss = FALSE, seed = 3L
)
#> Go/NoGo/Gray Decision Probabilities (Two Continuous Endpoints)
#> ----------------------------------------------------------------
#> Probability type : posterior
#> Design : uncontrolled
#> Prior : N-Inv-Wishart
#> Method : NULL
#> Simulations : nsim = 100
#> MC draws : nMC = 500
#> Seed : 3
#> Threshold(s) : TV1 = 1.5, MAV1 = 0.5
#> TV2 = 1, MAV2 = 0.3
#> Go threshold : gamma_go = 0.8
#> NoGo threshold : gamma_nogo = 0.8
#> Go regions : {1}
#> NoGo regions : {9}
#> Sample size : n_t = 20, n_c = NULL
#> True cov (treat.): Sigma_t = [4, 0.8; 0.8, 1]
#> Prior (treatment): kappa0_t = 2, nu0_t = 5, mu0_t = (2, 1)
#> Lambda0_t = [8, 0; 0, 2]
#> Hyp. control : mu0_c = (0, 0), r = 1
#> Miss handling : error_if_Miss = TRUE, Gray_inc_Miss = FALSE
#> ----------------------------------------------------------------
#> mu_t1 mu_t2 Go Gray NoGo
#> 1.0 0.5 0.0000 1.0000 0.0000
#> 2.5 1.5 0.6100 0.3900 0.0000
#> 4.0 2.5 1.0000 0.0000 0.0000
#> ----------------------------------------------------------------
# Example 3: External design (control only), posterior probability, NIW prior
Sigma <- matrix(c(4.0, 0.8, 0.8, 1.0), 2, 2)
L0 <- matrix(c(8.0, 0.0, 0.0, 2.0), 2, 2)
se_mat <- matrix(c(7.0, 1.2, 1.2, 1.8), 2, 2)
pbayesdecisionprob2cont(
nsim = 100L, prob = 'posterior', design = 'external',
prior = 'N-Inv-Wishart',
GoRegions = 1L, NoGoRegions = 9L,
gamma_go = 0.8, gamma_nogo = 0.8,
theta_TV1 = 1.5, theta_MAV1 = 0.5,
theta_TV2 = 1.0, theta_MAV2 = 0.3,
theta_NULL1 = NULL, theta_NULL2 = NULL,
n_t = 20L, n_c = 20L, m_t = NULL, m_c = NULL,
mu_t = rbind(c(1.0, 0.5), c(2.5, 1.5), c(4.0, 2.5)),
Sigma_t = Sigma,
mu_c = rbind(c(0.0, 0.0), c(0.0, 0.0), c(0.0, 0.0)),
Sigma_c = Sigma,
kappa0_t = 2.0, nu0_t = 5.0, mu0_t = c(2.0, 1.0), Lambda0_t = L0,
kappa0_c = 2.0, nu0_c = 5.0, mu0_c = c(0.0, 0.0), Lambda0_c = L0,
r = NULL,
ne_t = NULL, ne_c = 15L, alpha0e_t = NULL, alpha0e_c = 0.5,
bar_ye_t = NULL, bar_ye_c = c(0.2, 0.1), se_t = NULL, se_c = se_mat,
nMC = 500L, CalcMethod = 'MC',
error_if_Miss = TRUE, Gray_inc_Miss = FALSE, seed = 5L
)
#> Go/NoGo/Gray Decision Probabilities (Two Continuous Endpoints)
#> ---------------------------------------------------------------------
#> Probability type : posterior
#> Design : external
#> Prior : N-Inv-Wishart
#> Method : NULL
#> Simulations : nsim = 100
#> MC draws : nMC = 500
#> Seed : 5
#> Threshold(s) : TV1 = 1.5, MAV1 = 0.5
#> TV2 = 1, MAV2 = 0.3
#> Go threshold : gamma_go = 0.8
#> NoGo threshold : gamma_nogo = 0.8
#> Go regions : {1}
#> NoGo regions : {9}
#> Sample size : n_t = 20, n_c = 20
#> True cov (treat.): Sigma_t = [4, 0.8; 0.8, 1]
#> True cov (cont.) : Sigma_c = [4, 0.8; 0.8, 1]
#> Prior (treatment): kappa0_t = 2, nu0_t = 5, mu0_t = (2, 1)
#> Lambda0_t = [8, 0; 0, 2]
#> Prior (control) : kappa0_c = 2, nu0_c = 5, mu0_c = (0, 0)
#> Lambda0_c = [8, 0; 0, 2]
#> External (treat.): ne_t = NULL, alpha0e_t = NULL
#> External (cont.) : ne_c = 15, alpha0e_c = 0.5
#> bar_ye_c = (0.2, 0.1), se_c = (7, 1.2, 1.2, 1.8)
#> Miss handling : error_if_Miss = TRUE, Gray_inc_Miss = FALSE
#> ---------------------------------------------------------------------
#> mu_t1 mu_t2 mu_c1 mu_c2 Go Gray NoGo
#> 1.0 0.5 0 0 0.0000 1.0000 0.0000
#> 2.5 1.5 0 0 0.7000 0.3000 0.0000
#> 4.0 2.5 0 0 1.0000 0.0000 0.0000
#> ---------------------------------------------------------------------
# Example 4: Controlled design, predictive probability, NIW prior
Sigma <- matrix(c(4.0, 0.8, 0.8, 1.0), 2, 2)
L0 <- matrix(c(8.0, 0.0, 0.0, 2.0), 2, 2)
pbayesdecisionprob2cont(
nsim = 100L, prob = 'predictive', design = 'controlled',
prior = 'N-Inv-Wishart',
GoRegions = 1L, NoGoRegions = 4L,
gamma_go = 0.8, gamma_nogo = 0.8,
theta_TV1 = NULL, theta_MAV1 = NULL,
theta_TV2 = NULL, theta_MAV2 = NULL,
theta_NULL1 = 0.5, theta_NULL2 = 0.3,
n_t = 20L, n_c = 20L, m_t = 60L, m_c = 60L,
mu_t = rbind(c(1.0, 0.5), c(2.5, 1.5), c(4.0, 2.5)),
Sigma_t = Sigma,
mu_c = rbind(c(0.0, 0.0), c(0.0, 0.0), c(0.0, 0.0)),
Sigma_c = Sigma,
kappa0_t = 2.0, nu0_t = 5.0, mu0_t = c(2.0, 1.0), Lambda0_t = L0,
kappa0_c = 2.0, nu0_c = 5.0, mu0_c = c(0.0, 0.0), Lambda0_c = L0,
r = NULL,
ne_t = NULL, ne_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
bar_ye_t = NULL, bar_ye_c = NULL, se_t = NULL, se_c = NULL,
nMC = 500L, CalcMethod = 'MC',
error_if_Miss = TRUE, Gray_inc_Miss = FALSE, seed = 4L
)
#> Go/NoGo/Gray Decision Probabilities (Two Continuous Endpoints)
#> ----------------------------------------------------------------
#> Probability type : predictive
#> Design : controlled
#> Prior : N-Inv-Wishart
#> Method : NULL
#> Simulations : nsim = 100
#> MC draws : nMC = 500
#> Seed : 4
#> Threshold(s) : NULL1 = 0.5, NULL2 = 0.3
#> Go threshold : gamma_go = 0.8
#> NoGo threshold : gamma_nogo = 0.8
#> Go regions : {1}
#> NoGo regions : {4}
#> Sample size : n_t = 20, n_c = 20
#> True cov (treat.): Sigma_t = [4, 0.8; 0.8, 1]
#> True cov (cont.) : Sigma_c = [4, 0.8; 0.8, 1]
#> Prior (treatment): kappa0_t = 2, nu0_t = 5, mu0_t = (2, 1)
#> Lambda0_t = [8, 0; 0, 2]
#> Prior (control) : kappa0_c = 2, nu0_c = 5, mu0_c = (0, 0)
#> Lambda0_c = [8, 0; 0, 2]
#> Future trial : m_t = 60, m_c = 60
#> Miss handling : error_if_Miss = TRUE, Gray_inc_Miss = FALSE
#> ----------------------------------------------------------------
#> mu_t1 mu_t2 mu_c1 mu_c2 Go Gray NoGo
#> 1.0 0.5 0 0 0.4700 0.5300 0.0000
#> 2.5 1.5 0 0 1.0000 0.0000 0.0000
#> 4.0 2.5 0 0 1.0000 0.0000 0.0000
#> ----------------------------------------------------------------
# Example 5: Uncontrolled design, predictive probability, vague prior
Sigma <- matrix(c(4.0, 0.8, 0.8, 1.0), 2, 2)
pbayesdecisionprob2cont(
nsim = 100L, prob = 'predictive', design = 'uncontrolled',
prior = 'vague',
GoRegions = 1L, NoGoRegions = 4L,
gamma_go = 0.8, gamma_nogo = 0.8,
theta_TV1 = NULL, theta_MAV1 = NULL,
theta_TV2 = NULL, theta_MAV2 = NULL,
theta_NULL1 = 0.5, theta_NULL2 = 0.3,
n_t = 20L, n_c = NULL, m_t = 60L, m_c = 60L,
mu_t = rbind(c(1.0, 0.5), c(2.5, 1.5), c(4.0, 2.5)),
Sigma_t = Sigma,
mu_c = NULL,
Sigma_c = NULL,
kappa0_t = NULL, nu0_t = NULL, mu0_t = NULL, Lambda0_t = NULL,
kappa0_c = NULL, nu0_c = NULL, mu0_c = c(0.0, 0.0), Lambda0_c = NULL,
r = 1.0,
ne_t = NULL, ne_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
bar_ye_t = NULL, bar_ye_c = NULL, se_t = NULL, se_c = NULL,
nMC = 500L, CalcMethod = 'MC',
error_if_Miss = TRUE, Gray_inc_Miss = FALSE, seed = 8L
)
#> Go/NoGo/Gray Decision Probabilities (Two Continuous Endpoints)
#> ----------------------------------------------------------------
#> Probability type : predictive
#> Design : uncontrolled
#> Prior : vague
#> Method : NULL
#> Simulations : nsim = 100
#> MC draws : nMC = 500
#> Seed : 8
#> Threshold(s) : NULL1 = 0.5, NULL2 = 0.3
#> Go threshold : gamma_go = 0.8
#> NoGo threshold : gamma_nogo = 0.8
#> Go regions : {1}
#> NoGo regions : {4}
#> Sample size : n_t = 20, n_c = NULL
#> True cov (treat.): Sigma_t = [4, 0.8; 0.8, 1]
#> Hyp. control : mu0_c = (0, 0), r = 1
#> Future trial : m_t = 60, m_c = 60
#> Miss handling : error_if_Miss = TRUE, Gray_inc_Miss = FALSE
#> ----------------------------------------------------------------
#> mu_t1 mu_t2 Go Gray NoGo
#> 1.0 0.5 0.3300 0.6700 0.0000
#> 2.5 1.5 1.0000 0.0000 0.0000
#> 4.0 2.5 1.0000 0.0000 0.0000
#> ----------------------------------------------------------------
# Example 6: External design (control only), predictive probability, NIW prior
Sigma <- matrix(c(4.0, 0.8, 0.8, 1.0), 2, 2)
L0 <- matrix(c(8.0, 0.0, 0.0, 2.0), 2, 2)
se_mat <- matrix(c(7.0, 1.2, 1.2, 1.8), 2, 2)
pbayesdecisionprob2cont(
nsim = 100L, prob = 'predictive', design = 'external',
prior = 'N-Inv-Wishart',
GoRegions = 1L, NoGoRegions = 4L,
gamma_go = 0.8, gamma_nogo = 0.8,
theta_TV1 = NULL, theta_MAV1 = NULL,
theta_TV2 = NULL, theta_MAV2 = NULL,
theta_NULL1 = 0.5, theta_NULL2 = 0.3,
n_t = 20L, n_c = 20L, m_t = 60L, m_c = 60L,
mu_t = rbind(c(1.0, 0.5), c(2.5, 1.5), c(4.0, 2.5)),
Sigma_t = Sigma,
mu_c = rbind(c(0.0, 0.0), c(0.0, 0.0), c(0.0, 0.0)),
Sigma_c = Sigma,
kappa0_t = 2.0, nu0_t = 5.0, mu0_t = c(2.0, 1.0), Lambda0_t = L0,
kappa0_c = 2.0, nu0_c = 5.0, mu0_c = c(0.0, 0.0), Lambda0_c = L0,
r = NULL,
ne_t = NULL, ne_c = 15L, alpha0e_t = NULL, alpha0e_c = 0.5,
bar_ye_t = NULL, bar_ye_c = c(0.2, 0.1), se_t = NULL, se_c = se_mat,
nMC = 500L, CalcMethod = 'MC',
error_if_Miss = TRUE, Gray_inc_Miss = FALSE, seed = 9L
)
#> Go/NoGo/Gray Decision Probabilities (Two Continuous Endpoints)
#> ---------------------------------------------------------------------
#> Probability type : predictive
#> Design : external
#> Prior : N-Inv-Wishart
#> Method : NULL
#> Simulations : nsim = 100
#> MC draws : nMC = 500
#> Seed : 9
#> Threshold(s) : NULL1 = 0.5, NULL2 = 0.3
#> Go threshold : gamma_go = 0.8
#> NoGo threshold : gamma_nogo = 0.8
#> Go regions : {1}
#> NoGo regions : {4}
#> Sample size : n_t = 20, n_c = 20
#> True cov (treat.): Sigma_t = [4, 0.8; 0.8, 1]
#> True cov (cont.) : Sigma_c = [4, 0.8; 0.8, 1]
#> Prior (treatment): kappa0_t = 2, nu0_t = 5, mu0_t = (2, 1)
#> Lambda0_t = [8, 0; 0, 2]
#> Prior (control) : kappa0_c = 2, nu0_c = 5, mu0_c = (0, 0)
#> Lambda0_c = [8, 0; 0, 2]
#> Future trial : m_t = 60, m_c = 60
#> External (treat.): ne_t = NULL, alpha0e_t = NULL
#> External (cont.) : ne_c = 15, alpha0e_c = 0.5
#> bar_ye_c = (0.2, 0.1), se_c = (7, 1.2, 1.2, 1.8)
#> Miss handling : error_if_Miss = TRUE, Gray_inc_Miss = FALSE
#> ---------------------------------------------------------------------
#> mu_t1 mu_t2 mu_c1 mu_c2 Go Gray NoGo
#> 1.0 0.5 0 0 0.4100 0.5800 0.0100
#> 2.5 1.5 0 0 1.0000 0.0000 0.0000
#> 4.0 2.5 0 0 1.0000 0.0000 0.0000
#> ---------------------------------------------------------------------