View source: R/getgamma1cont.R
| getgamma1cont | R Documentation |
Computes the optimal Go threshold \gamma_{\mathrm{go}} and NoGo
threshold \gamma_{\mathrm{nogo}} for a single continuous endpoint by
searching over a grid of candidate values. The two thresholds are
calibrated independently under separate scenarios:
\gamma_{\mathrm{go}} is the smallest value in
gamma_grid such that the marginal Go probability
\Pr(g_{\mathrm{Go}} \ge \gamma_{\mathrm{go}}) is strictly
less than target_go under the Go-calibration scenario
(mu_t_go, mu_c_go, sigma_t_go,
sigma_c_go); typically the Null scenario.
\gamma_{\mathrm{nogo}} is the smallest value in
gamma_grid such that the marginal NoGo probability
\Pr(g_{\mathrm{NoGo}} \ge \gamma_{\mathrm{nogo}}) is
strictly less than target_nogo under the NoGo-calibration
scenario (mu_t_nogo, mu_c_nogo, sigma_t_nogo,
sigma_c_nogo); typically the Alternative scenario.
Here g_{\mathrm{Go}} = P(\theta > \theta_{\mathrm{TV}} \mid \bar{y}_t, s_t, \bar{y}_c, s_c)
and g_{\mathrm{NoGo}} = P(\theta \le \theta_{\mathrm{MAV}} \mid \bar{y}_t, s_t, \bar{y}_c, s_c)
for prob = 'posterior', consistent with the decision rule in
pbayesdecisionprob1cont.
getgamma1cont(
nsim,
prob = "posterior",
design = "controlled",
prior = "vague",
CalcMethod = "NI",
theta_TV = NULL,
theta_MAV = NULL,
theta_NULL = NULL,
nMC = NULL,
mu_t_go,
mu_c_go = NULL,
sigma_t_go,
sigma_c_go = NULL,
mu_t_nogo,
mu_c_nogo = NULL,
sigma_t_nogo,
sigma_c_nogo = NULL,
target_go,
target_nogo,
n_t,
n_c = NULL,
m_t = NULL,
m_c = NULL,
kappa0_t = NULL,
kappa0_c = NULL,
nu0_t = NULL,
nu0_c = NULL,
mu0_t = NULL,
mu0_c = NULL,
sigma0_t = NULL,
sigma0_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,
gamma_grid = seq(0.01, 0.99, by = 0.01),
seed
)
nsim |
A positive integer giving the number of Monte Carlo simulation replicates used to approximate the operating characteristics. |
prob |
A character string specifying the probability type.
Must be |
design |
A character string specifying the trial design.
Must be |
prior |
A character string specifying the prior distribution.
Must be |
CalcMethod |
A character string specifying the computation method
for |
theta_TV |
A numeric scalar giving the Target Value (TV) threshold
for the treatment effect. Required when |
theta_MAV |
A numeric scalar giving the Minimum Acceptable Value (MAV)
threshold. Must satisfy |
theta_NULL |
A numeric scalar giving the null hypothesis threshold
for the predictive probability. Required when
|
nMC |
A positive integer giving the number of inner Monte Carlo draws
passed to |
mu_t_go |
A numeric scalar giving the true mean for the treatment group under the Go-calibration scenario (typically Null). |
mu_c_go |
A numeric scalar giving the true mean for the control group
under the Go-calibration scenario. Set to |
sigma_t_go |
A positive numeric scalar giving the true standard deviation for the treatment group under the Go-calibration scenario. |
sigma_c_go |
A positive numeric scalar giving the true standard
deviation for the control group under the Go-calibration scenario.
Set to |
mu_t_nogo |
A numeric scalar giving the true mean for the treatment group under the NoGo-calibration scenario (typically Alternative). |
mu_c_nogo |
A numeric scalar giving the true mean for the control
group under the NoGo-calibration scenario. Set to |
sigma_t_nogo |
A positive numeric scalar giving the true standard deviation for the treatment group under the NoGo-calibration scenario. |
sigma_c_nogo |
A positive numeric scalar giving the true standard
deviation for the control group under the NoGo-calibration scenario.
Set to |
target_go |
A numeric scalar in |
target_nogo |
A numeric scalar in |
n_t |
A positive integer giving the number of patients in the treatment group in the PoC trial. |
n_c |
A positive integer giving the number of patients in the
control group in the PoC trial. Required for
|
m_t |
A positive integer giving the future sample size for the
treatment group. Required when |
m_c |
A positive integer giving the future sample size for the
control group. Required when |
kappa0_t |
A positive numeric scalar giving the prior precision
parameter for the treatment group under the N-Inv-Chi-squared prior.
Required when |
kappa0_c |
A positive numeric scalar giving the prior precision
parameter for the control group. Required when
|
nu0_t |
A positive numeric scalar giving the prior degrees of freedom
for the treatment group under the N-Inv-Chi-squared prior. Required
when |
nu0_c |
A positive numeric scalar giving the prior degrees of freedom
for the control group. Required when |
mu0_t |
A numeric scalar giving the prior mean for the treatment group
under the N-Inv-Chi-squared prior. Required when
|
mu0_c |
A numeric scalar giving the prior mean for the control group
(or the fixed hypothetical control mean for uncontrolled design).
Required when |
sigma0_t |
A positive numeric scalar giving the prior scale parameter
for the treatment group under the N-Inv-Chi-squared prior. Required
when |
sigma0_c |
A positive numeric scalar giving the prior scale parameter
for the control group. Required when |
r |
A positive numeric scalar giving the variance ratio
|
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
|
alpha0e_t |
A numeric scalar in |
alpha0e_c |
A numeric scalar in |
bar_ye_t |
A numeric scalar giving the sample mean of the external
treatment group data. Required when |
bar_ye_c |
A numeric scalar giving the sample mean of the external
control group data. Required when |
se_t |
A positive numeric scalar giving the sample standard deviation
of the external treatment group data. Required when |
se_c |
A positive numeric scalar giving the sample standard deviation
of the external control group data. Required when |
gamma_grid |
A numeric vector of candidate threshold values in
|
seed |
A numeric scalar for reproducible random number generation.
The Go-calibration simulation uses |
The function uses a two-stage simulate-then-sweep strategy:
Simulation: nsim datasets are generated
independently for each calibration scenario. For the
Go-calibration scenario, standardised residuals are shifted by
mu_t_go and mu_c_go; for the NoGo-calibration
scenario, by mu_t_nogo and mu_c_nogo.
pbayespostpred1cont is called once per scenario to
obtain g_{\mathrm{Go}} (lower.tail = FALSE at
theta_TV) and g_{\mathrm{NoGo}} (lower.tail
= TRUE at theta_MAV).
Gamma sweep: Marginal probabilities are estimated as the
proportion of simulated datasets satisfying the respective
indicator: g_{\mathrm{Go}} \ge \gamma for
PrGo_grid, and g_{\mathrm{NoGo}} \ge \gamma for
PrNoGo_grid. Both are monotone non-increasing in
\gamma.
The optimal \gamma_{\mathrm{go}} and \gamma_{\mathrm{nogo}}
are each the smallest grid value crossing below the respective
target probability.
A list of class getgamma1cont with the following elements:
Optimal Go threshold: the smallest value in
gamma_grid for which \Pr(\mathrm{Go}) < \code{target\_go}
under the Go-calibration scenario.
NA if no such value exists.
Optimal NoGo threshold: the smallest value in
gamma_grid for which \Pr(\mathrm{NoGo}) < \code{target\_nogo}
under the NoGo-calibration scenario.
NA if no such value exists.
Marginal \Pr(g_{\mathrm{Go}} \ge \gamma_{\mathrm{go}})
at the optimal \gamma_{\mathrm{go}} under the Go-calibration
scenario. NA if gamma_go is NA.
Marginal \Pr(g_{\mathrm{NoGo}} \ge \gamma_{\mathrm{nogo}})
at the optimal \gamma_{\mathrm{nogo}} under the NoGo-calibration
scenario. NA if gamma_nogo is NA.
The value of target_go supplied by the user.
The value of target_nogo supplied by the user.
A data frame with columns gamma_grid,
PrGo_grid (marginal Go probability under the Go-calibration
scenario), and PrNoGo_grid (marginal NoGo probability under
the NoGo-calibration scenario).
# Example 1: Controlled design, vague prior, posterior probability
# gamma_go : smallest gamma s.t. Pr(Go) < 0.05 under Null (mu_t = mu_c = 1.0)
# gamma_nogo: smallest gamma s.t. Pr(NoGo) < 0.20 under Alt (mu_t = 2.5, mu_c = 1.0)
getgamma1cont(
nsim = 1000L, prob = 'posterior', design = 'controlled',
prior = 'vague', CalcMethod = 'MM',
theta_TV = 1.5, theta_MAV = 0.0, theta_NULL = NULL, nMC = NULL,
mu_t_go = 1.0, mu_c_go = 1.0, sigma_t_go = 2.0, sigma_c_go = 2.0,
mu_t_nogo = 2.5, mu_c_nogo = 1.0, sigma_t_nogo = 2.0, sigma_c_nogo = 2.0,
target_go = 0.05, target_nogo = 0.20,
n_t = 15L, n_c = 15L, m_t = NULL, m_c = NULL,
kappa0_t = NULL, kappa0_c = NULL, nu0_t = NULL, nu0_c = NULL,
mu0_t = NULL, mu0_c = NULL, sigma0_t = NULL, sigma0_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,
gamma_grid = seq(0.01, 0.99, by = 0.01), seed = 1L
)
# Example 2: Uncontrolled design, N-Inv-Chisq prior, posterior probability
getgamma1cont(
nsim = 1000L, prob = 'posterior', design = 'uncontrolled',
prior = 'N-Inv-Chisq', CalcMethod = 'NI',
theta_TV = 1.0, theta_MAV = 0.0, theta_NULL = NULL, nMC = NULL,
mu_t_go = 1.5, mu_c_go = NULL, sigma_t_go = 1.5, sigma_c_go = NULL,
mu_t_nogo = 3.0, mu_c_nogo = NULL, sigma_t_nogo = 1.5, sigma_c_nogo = NULL,
target_go = 0.05, target_nogo = 0.20,
n_t = 20L, n_c = NULL, m_t = NULL, m_c = NULL,
kappa0_t = 2, kappa0_c = NULL, nu0_t = 5, nu0_c = NULL,
mu0_t = 3.0, mu0_c = 1.5, sigma0_t = 1.5, sigma0_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,
gamma_grid = seq(0.01, 0.99, by = 0.01), seed = 2L
)
# Example 3: External design, vague prior, posterior probability
getgamma1cont(
nsim = 1000L, prob = 'posterior', design = 'external',
prior = 'vague', CalcMethod = 'MM',
theta_TV = 1.0, theta_MAV = 0.0, theta_NULL = NULL, nMC = NULL,
mu_t_go = 1.0, mu_c_go = 1.0, sigma_t_go = 1.5, sigma_c_go = 1.5,
mu_t_nogo = 2.5, mu_c_nogo = 1.0, sigma_t_nogo = 1.5, sigma_c_nogo = 1.5,
target_go = 0.05, target_nogo = 0.20,
n_t = 15L, n_c = 15L, m_t = NULL, m_c = NULL,
kappa0_t = NULL, kappa0_c = NULL, nu0_t = NULL, nu0_c = NULL,
mu0_t = NULL, mu0_c = NULL, sigma0_t = NULL, sigma0_c = NULL,
r = NULL, ne_t = NULL, ne_c = 20L, alpha0e_t = NULL, alpha0e_c = 0.5,
bar_ye_t = NULL, bar_ye_c = 0.0, se_t = NULL, se_c = 1.5,
gamma_grid = seq(0.01, 0.99, by = 0.01), seed = 4L
)
# Example 4: Controlled design, vague prior, predictive probability
getgamma1cont(
nsim = 1000L, prob = 'predictive', design = 'controlled',
prior = 'vague', CalcMethod = 'MM',
theta_TV = NULL, theta_MAV = NULL, theta_NULL = 1.0, nMC = NULL,
mu_t_go = 1.0, mu_c_go = 1.0, sigma_t_go = 2.0, sigma_c_go = 2.0,
mu_t_nogo = 2.5, mu_c_nogo = 1.0, sigma_t_nogo = 2.0, sigma_c_nogo = 2.0,
target_go = 0.05, target_nogo = 0.20,
n_t = 15L, n_c = 15L, m_t = 50L, m_c = 50L,
kappa0_t = NULL, kappa0_c = NULL, nu0_t = NULL, nu0_c = NULL,
mu0_t = NULL, mu0_c = NULL, sigma0_t = NULL, sigma0_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,
gamma_grid = seq(0.01, 0.99, by = 0.01), seed = 3L
)
# Example 5: Uncontrolled design, vague prior, predictive probability
getgamma1cont(
nsim = 1000L, prob = 'predictive', design = 'uncontrolled',
prior = 'vague', CalcMethod = 'MM',
theta_TV = NULL, theta_MAV = NULL, theta_NULL = 1.0, nMC = NULL,
mu_t_go = 1.0, mu_c_go = NULL, sigma_t_go = 2.0, sigma_c_go = NULL,
mu_t_nogo = 2.5, mu_c_nogo = NULL, sigma_t_nogo = 2.0, sigma_c_nogo = NULL,
target_go = 0.05, target_nogo = 0.20,
n_t = 15L, n_c = NULL, m_t = 50L, m_c = 50L,
kappa0_t = NULL, kappa0_c = NULL, nu0_t = NULL, nu0_c = NULL,
mu0_t = NULL, mu0_c = 0.0, sigma0_t = NULL, sigma0_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,
gamma_grid = seq(0.01, 0.99, by = 0.01), seed = 5L
)
# Example 6: External design, vague prior, predictive probability
getgamma1cont(
nsim = 1000L, prob = 'predictive', design = 'external',
prior = 'vague', CalcMethod = 'MM',
theta_TV = NULL, theta_MAV = NULL, theta_NULL = 1.0, nMC = NULL,
mu_t_go = 1.0, mu_c_go = 1.0, sigma_t_go = 1.5, sigma_c_go = 1.5,
mu_t_nogo = 2.5, mu_c_nogo = 1.0, sigma_t_nogo = 1.5, sigma_c_nogo = 1.5,
target_go = 0.05, target_nogo = 0.20,
n_t = 15L, n_c = 15L, m_t = 50L, m_c = 50L,
kappa0_t = NULL, kappa0_c = NULL, nu0_t = NULL, nu0_c = NULL,
mu0_t = NULL, mu0_c = NULL, sigma0_t = NULL, sigma0_c = NULL,
r = NULL, ne_t = NULL, ne_c = 20L, alpha0e_t = NULL, alpha0e_c = 0.5,
bar_ye_t = NULL, bar_ye_c = 0.0, se_t = NULL, se_c = 1.5,
gamma_grid = seq(0.01, 0.99, by = 0.01), seed = 6L
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.