View source: R/pbayesdecisionprob1bin.R
| pbayesdecisionprob1bin | R Documentation |
Evaluates operating characteristics (Go, NoGo, Gray probabilities) for binary-outcome clinical trials under the Bayesian framework by enumerating all possible trial outcomes. The function supports controlled, uncontrolled, and external designs.
pbayesdecisionprob1bin(
prob = "posterior",
design = "controlled",
theta_TV = NULL,
theta_MAV = NULL,
theta_NULL = NULL,
gamma_go,
gamma_nogo,
pi_t,
pi_c = NULL,
n_t,
n_c,
a_t,
a_c,
b_t,
b_c,
z = NULL,
m_t = NULL,
m_c = NULL,
ne_t = NULL,
ne_c = NULL,
ye_t = NULL,
ye_c = NULL,
alpha0e_t = NULL,
alpha0e_c = NULL,
error_if_Miss = TRUE,
Gray_inc_Miss = FALSE
)
prob |
A character string specifying the probability type.
Must be |
design |
A character string specifying the trial design.
Must be |
theta_TV |
A numeric scalar giving the target value (TV) threshold used for
the Go decision when |
theta_MAV |
A numeric scalar giving the minimum acceptable value (MAV)
threshold used for the NoGo decision when |
theta_NULL |
A numeric scalar giving the null hypothesis threshold used for
both Go and NoGo decisions when |
gamma_go |
A numeric scalar in |
gamma_nogo |
A numeric scalar in |
pi_t |
A numeric value or vector giving the true response probability(s) for
the treatment group used to evaluate operating characteristics. Each element
must be in |
pi_c |
A numeric value or vector giving the true response probability(s) for
the control group. For |
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 |
a_t |
A positive numeric scalar giving the first shape parameter (alpha) of the prior Beta distribution for the treatment group. |
a_c |
A positive numeric scalar giving the first shape parameter (alpha) of the prior Beta distribution for the control group. |
b_t |
A positive numeric scalar giving the second shape parameter (beta) of the prior Beta distribution for the treatment group. |
b_c |
A positive numeric scalar giving the second shape parameter (beta) of the prior Beta distribution for the control group. |
z |
A non-negative integer giving the hypothetical number of responders
in the control group. Required when |
m_t |
A positive integer giving the number of patients in the
treatment group for the future trial. Required when
|
m_c |
A positive integer giving the number of patients in the
control group for the future trial. Required when
|
ne_t |
A positive integer giving the number of patients in the
treatment group of the external data set. Required when
|
ne_c |
A positive integer giving the number of patients in the
control group of the external data set. Required when
|
ye_t |
A non-negative integer giving the number of responders in the
treatment group of the external data set. Required when
|
ye_c |
A non-negative integer giving the number of responders in the
control group of the external data set. Required when
|
alpha0e_t |
A numeric scalar in |
alpha0e_c |
A numeric scalar in |
error_if_Miss |
A logical scalar; if |
Gray_inc_Miss |
A logical scalar; if |
Operating characteristics are computed by exact enumeration:
All possible outcome pairs (y_t, y_c) with y_t \in \{0,\ldots,n_t\}
and y_c \in \{0,\ldots,n_c\} (or fixed at z for uncontrolled) are
evaluated.
For each pair, pbayespostpred1bin computes the posterior or predictive
probability at both thresholds (TV/MAV or NULL).
Outcomes are classified into Go, NoGo, Miss, or Gray:
Go: P(\mathrm{Go}) \ge \gamma_1 AND
P(\mathrm{NoGo}) < \gamma_2
NoGo: P(\mathrm{Go}) < \gamma_1 AND
P(\mathrm{NoGo}) \ge \gamma_2
Miss: both Go and NoGo criteria met simultaneously
Gray: neither Go nor NoGo criteria met
Each outcome is weighted by its binomial probability under the true rates.
A data frame with one row per pi_t scenario and columns:
True treatment response probability.
True control response probability (omitted for uncontrolled design).
Probability of making a Go decision.
Probability of making a Gray (inconclusive) decision.
Probability of making a NoGo decision.
(Optional) 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 pbayesdecisionprob1bin with an associated
print method.
# Example 1: Controlled design with posterior probability
pbayesdecisionprob1bin(
prob = 'posterior', design = 'controlled',
theta_TV = 0.4, theta_MAV = 0.2, theta_NULL = NULL,
gamma_go = 0.8, gamma_nogo = 0.2,
pi_t = c(0.2, 0.4, 0.6, 0.8), pi_c = rep(0.2, 4),
n_t = 12, n_c = 12,
a_t = 0.5, a_c = 0.5, b_t = 0.5, b_c = 0.5,
z = NULL, m_t = NULL, m_c = NULL,
ne_t = NULL, ne_c = NULL, ye_t = NULL, ye_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
error_if_Miss = TRUE, Gray_inc_Miss = FALSE
)
# Example 2: Uncontrolled design with hypothetical control
pbayesdecisionprob1bin(
prob = 'posterior', design = 'uncontrolled',
theta_TV = 0.30, theta_MAV = 0.15, theta_NULL = NULL,
gamma_go = 0.75, gamma_nogo = 0.25,
pi_t = c(0.3, 0.5, 0.7), pi_c = NULL,
n_t = 15, n_c = 15,
a_t = 0.5, a_c = 0.5, b_t = 0.5, b_c = 0.5,
z = 5, m_t = NULL, m_c = NULL,
ne_t = NULL, ne_c = NULL, ye_t = NULL, ye_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
error_if_Miss = TRUE, Gray_inc_Miss = FALSE
)
# Example 3: External design with 50 percent power prior borrowing
pbayesdecisionprob1bin(
prob = 'posterior', design = 'external',
theta_TV = 0.4, theta_MAV = 0.2, theta_NULL = NULL,
gamma_go = 0.8, gamma_nogo = 0.2,
pi_t = c(0.2, 0.4, 0.6, 0.8), pi_c = rep(0.2, 4),
n_t = 12, n_c = 12,
a_t = 0.5, a_c = 0.5, b_t = 0.5, b_c = 0.5,
z = NULL, m_t = NULL, m_c = NULL,
ne_t = 15, ne_c = 15, ye_t = 6, ye_c = 4, alpha0e_t = 0.5, alpha0e_c = 0.5,
error_if_Miss = TRUE, Gray_inc_Miss = FALSE
)
# Example 4: Posterior predictive probability for controlled design
pbayesdecisionprob1bin(
prob = 'predictive', design = 'controlled',
theta_TV = NULL, theta_MAV = NULL, theta_NULL = 0,
gamma_go = 0.9, gamma_nogo = 0.3,
pi_t = c(0.2, 0.4, 0.6, 0.8), pi_c = rep(0.2, 4),
n_t = 12, n_c = 12,
a_t = 0.5, a_c = 0.5, b_t = 0.5, b_c = 0.5,
z = NULL, m_t = 30, m_c = 30,
ne_t = NULL, ne_c = NULL, ye_t = NULL, ye_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
error_if_Miss = TRUE, Gray_inc_Miss = FALSE
)
# Example 5: Uncontrolled design with posterior predictive probability
pbayesdecisionprob1bin(
prob = 'predictive', design = 'uncontrolled',
theta_TV = NULL, theta_MAV = NULL, theta_NULL = 0,
gamma_go = 0.75, gamma_nogo = 0.25,
pi_t = c(0.3, 0.5, 0.7), pi_c = NULL,
n_t = 15, n_c = 15,
a_t = 0.5, a_c = 0.5, b_t = 0.5, b_c = 0.5,
z = 5, m_t = 30, m_c = 30,
ne_t = NULL, ne_c = NULL, ye_t = NULL, ye_c = NULL, alpha0e_t = NULL, alpha0e_c = NULL,
error_if_Miss = TRUE, Gray_inc_Miss = FALSE
)
# Example 6: External design with posterior predictive probability
pbayesdecisionprob1bin(
prob = 'predictive', design = 'external',
theta_TV = NULL, theta_MAV = NULL, theta_NULL = 0,
gamma_go = 0.9, gamma_nogo = 0.3,
pi_t = c(0.2, 0.4, 0.6, 0.8), pi_c = rep(0.2, 4),
n_t = 12, n_c = 12,
a_t = 0.5, a_c = 0.5, b_t = 0.5, b_c = 0.5,
z = NULL, m_t = 30, m_c = 30,
ne_t = 15, ne_c = 15, ye_t = 6, ye_c = 4, alpha0e_t = 0.5, alpha0e_c = 0.5,
error_if_Miss = TRUE, Gray_inc_Miss = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.