View source: R/pbayespostpred2bin.R
| pbayespostpred2bin | R Documentation |
Computes the Bayesian posterior probability or posterior predictive probability for clinical trials with two binary endpoints under a Dirichlet-multinomial conjugate model. The function returns probabilities for nine decision regions (posterior) or four decision regions (predictive) defined by target values (TV) and minimum acceptable values (MAV) for both endpoints. Three study designs are supported: controlled, uncontrolled (hypothetical control), and external (power prior).
pbayespostpred2bin(
prob = "posterior",
design = "controlled",
theta_TV1 = NULL,
theta_MAV1 = NULL,
theta_TV2 = NULL,
theta_MAV2 = NULL,
theta_NULL1 = NULL,
theta_NULL2 = NULL,
x_t_00,
x_t_01,
x_t_10,
x_t_11,
x_c_00 = NULL,
x_c_01 = NULL,
x_c_10 = NULL,
x_c_11 = 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,
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
)
prob |
A character string specifying the probability type.
Must be |
design |
A character string specifying the trial design.
Must be |
theta_TV1 |
A numeric scalar giving the target value (TV) threshold
for Endpoint 1. Required when |
theta_MAV1 |
A numeric scalar giving the minimum acceptable value
(MAV) threshold for Endpoint 1. Required when
|
theta_TV2 |
A numeric scalar giving the target value (TV) threshold
for Endpoint 2. Required when |
theta_MAV2 |
A numeric scalar giving the minimum acceptable value
(MAV) threshold for Endpoint 2. Required when
|
theta_NULL1 |
A numeric scalar giving the null hypothesis threshold
for Endpoint 1. Required when |
theta_NULL2 |
A numeric scalar giving the null hypothesis threshold
for Endpoint 2. Required when |
x_t_00 |
A non-negative integer giving the count of
|
x_t_01 |
A non-negative integer giving the count of |
x_t_10 |
A non-negative integer giving the count of |
x_t_11 |
A non-negative integer giving the count of |
x_c_00 |
A non-negative integer giving the count of |
x_c_01 |
A non-negative integer giving the count of |
x_c_10 |
A non-negative integer giving the count of |
x_c_11 |
A non-negative integer giving the count of |
a_t_00 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_t_01 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_t_10 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_t_11 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_c_00 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_c_01 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_c_10 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
a_c_11 |
A positive numeric scalar giving the Dirichlet prior
parameter for the |
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
|
z00 |
A non-negative integer giving the hypothetical control count
for pattern |
z01 |
A non-negative integer giving the hypothetical control count
for pattern |
z10 |
A non-negative integer giving the hypothetical control count
for pattern |
z11 |
A non-negative integer giving the hypothetical control count
for pattern |
xe_t_00 |
A non-negative integer giving the external treatment group
count for pattern |
xe_t_01 |
A non-negative integer giving the external treatment group
count for pattern |
xe_t_10 |
A non-negative integer giving the external treatment group
count for pattern |
xe_t_11 |
A non-negative integer giving the external treatment group
count for pattern |
xe_c_00 |
A non-negative integer giving the external control group
count for pattern |
xe_c_01 |
A non-negative integer giving the external control group
count for pattern |
xe_c_10 |
A non-negative integer giving the external control group
count for pattern |
xe_c_11 |
A non-negative integer giving the external control group
count for pattern |
alpha0e_t |
A numeric scalar in |
alpha0e_c |
A numeric scalar in |
nMC |
A positive integer giving the number of Monte Carlo draws used
to estimate region probabilities. Default is |
Model. The four response categories are ordered as
(0, 0), (0, 1), (1, 0), (1, 1). For each
group j, the observed count vector follows a multinomial
distribution, and a conjugate Dirichlet prior is placed on the cell
probability vector p_j:
p_j \sim \mathrm{Dir}(\alpha_{j,00}, \alpha_{j,01}, \alpha_{j,10},
\alpha_{j,11}).
The posterior is
p_j \mid x_j \sim \mathrm{Dir}(\alpha_{j,00} + x_{j,00},
\alpha_{j,01} + x_{j,01}, \alpha_{j,10} + x_{j,10},
\alpha_{j,11} + x_{j,11}).
Marginal response rates are \pi_{j1} = p_{j,10} + p_{j,11}
(Endpoint 1) and \pi_{j2} = p_{j,01} + p_{j,11} (Endpoint 2).
Treatment effects are \theta_1 = \pi_{t1} - \pi_{c1} and
\theta_2 = \pi_{t2} - \pi_{c2}.
Uncontrolled design. When design = 'uncontrolled', the
hypothetical control distribution is specified as a Dirichlet
distribution directly via the prior hyperparameters and hypothetical
control counts z00, z01, z10, z11.
External design. When design = 'external', the power
prior augments the Dirichlet prior parameters.
A named numeric vector of region probabilities. For
prob = 'posterior': length 9, named R1, ...,
R9, corresponding to regions defined by TV and MAV
thresholds for both endpoints (row-major order: Endpoint 1 varies
slowest). For prob = 'predictive': length 4, named
R1, ..., R4. All elements are non-negative and sum
to 1.
# Example 1: Controlled design - posterior probability
pbayespostpred2bin(
prob = 'posterior', design = 'controlled',
theta_TV1 = 0.15, theta_MAV1 = 0.05, theta_TV2 = 0.10, theta_MAV2 = 0.0,
theta_NULL1 = NULL, theta_NULL2 = NULL,
x_t_00 = 2, x_t_01 = 3, x_t_10 = 5, x_t_11 = 2,
x_c_00 = 3, x_c_01 = 2, x_c_10 = 4, x_c_11 = 1,
a_t_00 = 1, a_t_01 = 1, a_t_10 = 1, a_t_11 = 1,
a_c_00 = 1, a_c_01 = 1, a_c_10 = 1, a_c_11 = 1,
m_t = NULL, m_c = 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
)
# Example 2: Uncontrolled design - posterior probability
pbayespostpred2bin(
prob = 'posterior', design = 'uncontrolled',
theta_TV1 = 0.15, theta_MAV1 = 0.05, theta_TV2 = 0.10, theta_MAV2 = 0.0,
theta_NULL1 = NULL, theta_NULL2 = NULL,
x_t_00 = 2, x_t_01 = 3, x_t_10 = 5, x_t_11 = 2,
x_c_00 = NULL, x_c_01 = NULL, x_c_10 = NULL, x_c_11 = NULL,
a_t_00 = 1, a_t_01 = 1, a_t_10 = 1, a_t_11 = 1,
a_c_00 = 1, a_c_01 = 1, a_c_10 = 1, a_c_11 = 1,
m_t = NULL, m_c = NULL,
z00 = 1, z01 = 2, z10 = 2, z11 = 1,
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
)
# Example 3: External design - posterior probability
pbayespostpred2bin(
prob = 'posterior', design = 'external',
theta_TV1 = 0.15, theta_MAV1 = 0.05, theta_TV2 = 0.10, theta_MAV2 = 0.0,
theta_NULL1 = NULL, theta_NULL2 = NULL,
x_t_00 = 2, x_t_01 = 3, x_t_10 = 5, x_t_11 = 2,
x_c_00 = 3, x_c_01 = 2, x_c_10 = 4, x_c_11 = 1,
a_t_00 = 1, a_t_01 = 1, a_t_10 = 1, a_t_11 = 1,
a_c_00 = 1, a_c_01 = 1, a_c_10 = 1, a_c_11 = 1,
m_t = NULL, m_c = NULL,
z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL,
xe_t_00 = 2, xe_t_01 = 2, xe_t_10 = 3, xe_t_11 = 1,
xe_c_00 = 2, xe_c_01 = 1, xe_c_10 = 2, xe_c_11 = 1,
alpha0e_t = 0.5, alpha0e_c = 0.5
)
# Example 4: Controlled design - posterior predictive probability
pbayespostpred2bin(
prob = 'predictive', design = 'controlled',
theta_TV1 = NULL, theta_MAV1 = NULL, theta_TV2 = NULL, theta_MAV2 = NULL,
theta_NULL1 = 0.05, theta_NULL2 = 0.0,
x_t_00 = 2, x_t_01 = 3, x_t_10 = 5, x_t_11 = 2,
x_c_00 = 3, x_c_01 = 2, x_c_10 = 4, x_c_11 = 1,
a_t_00 = 1, a_t_01 = 1, a_t_10 = 1, a_t_11 = 1,
a_c_00 = 1, a_c_01 = 1, a_c_10 = 1, a_c_11 = 1,
m_t = 20, m_c = 20,
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
)
# Example 5: Uncontrolled design - posterior predictive probability
pbayespostpred2bin(
prob = 'predictive', design = 'uncontrolled',
theta_TV1 = NULL, theta_MAV1 = NULL, theta_TV2 = NULL, theta_MAV2 = NULL,
theta_NULL1 = 0.05, theta_NULL2 = 0.0,
x_t_00 = 2, x_t_01 = 3, x_t_10 = 5, x_t_11 = 2,
x_c_00 = NULL, x_c_01 = NULL, x_c_10 = NULL, x_c_11 = NULL,
a_t_00 = 1, a_t_01 = 1, a_t_10 = 1, a_t_11 = 1,
a_c_00 = 1, a_c_01 = 1, a_c_10 = 1, a_c_11 = 1,
m_t = 20, m_c = 20,
z00 = 1, z01 = 2, z10 = 2, z11 = 1,
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
)
# Example 6: External design - posterior predictive probability
pbayespostpred2bin(
prob = 'predictive', design = 'external',
theta_TV1 = NULL, theta_MAV1 = NULL, theta_TV2 = NULL, theta_MAV2 = NULL,
theta_NULL1 = 0.05, theta_NULL2 = 0.0,
x_t_00 = 2, x_t_01 = 3, x_t_10 = 5, x_t_11 = 2,
x_c_00 = 3, x_c_01 = 2, x_c_10 = 4, x_c_11 = 1,
a_t_00 = 1, a_t_01 = 1, a_t_10 = 1, a_t_11 = 1,
a_c_00 = 1, a_c_01 = 1, a_c_10 = 1, a_c_11 = 1,
m_t = 20, m_c = 20,
z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL,
xe_t_00 = 2, xe_t_01 = 2, xe_t_10 = 3, xe_t_11 = 1,
xe_c_00 = 2, xe_c_01 = 1, xe_c_10 = 2, xe_c_11 = 1,
alpha0e_t = 0.5, alpha0e_c = 0.5
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.