| Title: | Bayesian Quantitative Decision-Making Framework for Binary, Continuous and Time-to-Event Endpoints |
|---|---|
| Description: | Bayesian quantitative decision-making for proof-of-concept clinical trials with Go, NoGo and Gray decisions. A study is specified by its sample sizes, conjugate prior distributions, external data borrowed through power priors, a concurrent, external, hypothetical or fixed control group, and a decision criterion based on the posterior or posterior predictive probability of the treatment effect. The package computes the decision for observed data, the operating characteristics of a design under scenarios for the true parameters, the decision thresholds that control the probabilities of false Go and false NoGo decisions, and the observed data that lead to each decision. One or two binary endpoints (Beta-binomial and Dirichlet-multinomial models), one or two continuous endpoints (Normal-Inverse-chi-squared and Normal-Inverse-Wishart models) and one time-to-event endpoint evaluated by the milestone survival probability or the hazard ratio (exponential model with Gamma priors) are supported, with larger or smaller effects as favorable. The posterior distributions have closed forms, so Markov chain Monte Carlo (MCMC) sampling is not needed; the probabilities are computed from closed-form distribution functions, by exact summation, numerical integration, a moment-matching approximation or Monte Carlo simulation, with the main computations in C++. See Kang, Yamaguchi, and Han (2026) <doi:10.1080/10543406.2026.2655410> for the methodological framework. |
| Authors: | Gosuke Homma [aut, cre], Yusuke Yamaguchi [aut] |
| Maintainer: | Gosuke Homma <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0.1 |
| Built: | 2026-10-31 18:49:50 UTC |
| Source: | https://github.com/cran/BayesianQDM |
Specifies external (historical) data for one group together with the
power prior weight . The likelihood of the external data is raised
to the power , so that ignores the external data and
pools it with the current data. For the conjugate models used
in this package the resulting posterior distribution has a closed form, so
no Markov chain Monte Carlo sampling is needed.
borrow(data, a0)borrow(data, a0)
data |
External data created by |
a0 |
Power prior weight, a number from 0 to 1. |
An object of class "qdm_borrow" with elements data and
a0.
borrow(data_binary(n = 20, y = 8), a0 = 0.5)borrow(data_binary(n = 20, y = 8), a0 = 0.5)
Converts the marginal response rates of two binary endpoints and their correlation into the probabilities of the four joint response patterns.
cellprob_binary2(pi1, pi2, rho, tol = 1e-10)cellprob_binary2(pi1, pi2, rho, tol = 1e-10)
pi1 |
Response rate of endpoint 1, strictly between 0 and 1. |
pi2 |
Response rate of endpoint 2, strictly between 0 and 1. |
rho |
Correlation between the two endpoints. |
tol |
Tolerance for the feasibility check. |
For two Bernoulli variables with response rates and
, the Pearson correlation determines
and , ,
. All four probabilities are
non-negative only if
, which
bounds the feasible range of . An error is raised if rho
is outside this range by more than tol.
A named numeric vector of the probabilities of the cells
"00", "01", "10" and "11" (first digit:
endpoint 1; second digit: endpoint 2), summing to 1.
Other distributions:
pbetabinomdiff(),
pbetadiff(),
phazardratio(),
psurvdiff(),
ptdiff(),
rdirichlet()
cellprob_binary2(pi1 = 0.3, pi2 = 0.4, rho = 0.3)cellprob_binary2(pi1 = 0.3, pi2 = 0.4, rho = 0.3)
Specifies how subjects are enrolled, how they drop out and when the
analysis takes place. The operating characteristics of a design with a
time-to-event endpoint (design_tte) are computed by
simulating studies conducted in this way, and the posterior predictive
probabilities by simulating future studies.
conduct_tte( accrual_time, accrual_rate = rep(1, length(accrual_time) - 1L), dropout_time = 0, dropout_hazard = 0, cut_time = NULL, cut_events = NULL )conduct_tte( accrual_time, accrual_rate = rep(1, length(accrual_time) - 1L), dropout_time = 0, dropout_hazard = 0, cut_time = NULL, cut_events = NULL )
accrual_time |
Boundaries of the enrollment intervals: an increasing numeric vector that starts at 0, of length at least 2. |
accrual_rate |
Non-negative relative enrollment rates of the
intervals, one fewer than |
dropout_time |
Start times of the pieces of the dropout hazard: an increasing numeric vector that starts at 0. |
dropout_hazard |
Non-negative dropout hazards of the pieces, of the
same length as |
cut_time |
Calendar time of the analysis after the start of
enrollment (positive), or |
cut_events |
Number of events that triggers the analysis (a whole
number of at least 1), or |
The subjects of all groups are enrolled at independent times with a
piecewise uniform distribution: the enrollment period is divided by
accrual_time, and the probability of an interval is proportional
to its rate in accrual_rate times its length (only the relative
rates matter). The dropout time of a subject, measured from enrollment,
has a piecewise exponential distribution with hazard
dropout_hazard[j] from time dropout_time[j] (the last hazard
applies until infinity), independently of the event time. The analysis
takes place at the calendar time cut_time after the start of
enrollment, or at the calendar time of the cut_events-th event
among all subjects of the study (if fewer events occur, all subjects are
followed until their event or dropout). A subject enrolled at time
with event time and dropout time contributes the
observed time (0 if enrolled after the
analysis) and an event if and .
An object of class "qdm_conduct" with the arguments and the
element accrual_cum, the cumulative probabilities of enrollment
at the ends of the intervals.
# Enrollment over 15 months with increasing rates, dropout hazard 0.00226 # per month, analysis 15.44 months after the start of enrollment conduct_tte(accrual_time = c(0, 5, 10, 15), accrual_rate = c(0.4, 2, 4.5), dropout_hazard = 0.00226, cut_time = 15.44) # Uniform enrollment over 12 months, analysis at the 20th event conduct_tte(accrual_time = c(0, 12), cut_events = 20)# Enrollment over 15 months with increasing rates, dropout hazard 0.00226 # per month, analysis 15.44 months after the start of enrollment conduct_tte(accrual_time = c(0, 5, 10, 15), accrual_rate = c(0.4, 2, 4.5), dropout_hazard = 0.00226, cut_time = 15.44) # Uniform enrollment over 12 months, analysis at the 20th event conduct_tte(accrual_time = c(0, 12), cut_events = 20)
Specifies a Go/NoGo decision criterion based on the posterior probability
of the treatment effect (the difference between the treatment
and control groups, or their hazard ratio for a time-to-event endpoint)
given the proof-of-concept data .
criterion_posterior( theta_tv, theta_mav, gamma_go, gamma_nogo, go_regions = 1L, nogo_regions = 9L, rule = c("joint", "and", "or"), direction = "greater" )criterion_posterior( theta_tv, theta_mav, gamma_go, gamma_nogo, go_regions = 1L, nogo_regions = 9L, rule = c("joint", "and", "or"), direction = "greater" )
theta_tv |
Target value (TV) of the treatment effect: a number for one endpoint or a numeric vector of length 2 for two endpoints. |
theta_mav |
Minimum acceptable value (MAV) of the treatment effect, of
the same length as |
gamma_go |
Probability threshold for the Go criterion, strictly
between 0 and 1. With |
gamma_nogo |
Probability threshold for the NoGo criterion, strictly
between 0 and 1, given in the same way as |
go_regions |
Region numbers (from 1 to 9) forming the Go region for two
endpoints with |
nogo_regions |
Region numbers (from 1 to 9) forming the NoGo region for
two endpoints with |
rule |
For two endpoints, |
direction |
|
For one endpoint, the Go region is and the NoGo
region is . The Go criterion is
and the NoGo
criterion is .
In the notation of Kang et al. (2026), where the NoGo criterion is
, this corresponds to
.
By default, larger effects are favorable (direction = "greater",
with ), as for most efficacy endpoints.
For an endpoint on which smaller effects are favorable, such as the rate
of an adverse event or a hazard ratio, direction = "less" reverses
the inequalities (with ): the Go region
is , the NoGo region is
, and the criteria are
and
.
For two endpoints, the target values and minimum acceptable values divide
the plane of into nine regions (see
qdm_regions). The Go criterion is that the posterior
probability of the union of go_regions is at least
, and the NoGo criterion is that the posterior probability
of the union of nogo_regions is at least
(Yamaguchi et al., submitted, equations 2 and 3). With rule = "and"
or "or", the criteria are instead based on the marginal posterior
probabilities of each endpoint (equations 4 and 5): the Go criterion is
and (or)
, and the NoGo
criterion is and (or)
.
With two endpoints, direction can differ between the endpoints,
for example an efficacy endpoint ("greater") and a safety endpoint
("less"). The regions are then defined on the favorable side of
each endpoint: region 1 has both effects beyond their target values in
the favorable direction (see qdm_regions).
The decision is Go if only the Go criterion is met, NoGo if only the NoGo
criterion is met, Gray if neither is met, and Miss if both are met. For one
endpoint, Miss can occur only when .
An object of class
c("qdm_criterion_posterior", "qdm_criterion").
Kang, R., Yamaguchi, Y. and Han, C. (2026). Bayesian quantitative decision-making framework in cell and gene therapy development for rare diseases. Journal of Biopharmaceutical Statistics. doi:10.1080/10543406.2026.2655410
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
Other criteria:
criterion_predictive()
# One endpoint criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) # Two endpoints criterion_posterior(theta_tv = c(0.2, 0.15), theta_mav = c(0.1, 0.05), gamma_go = 0.3, gamma_nogo = 0.4) # Two endpoints, marginal criteria combined with AND criterion_posterior(theta_tv = c(0.2, 0.15), theta_mav = c(0.1, 0.05), gamma_go = c(0.6, 0.5), gamma_nogo = 0.7, rule = "and") # Rate of an adverse event: Go if it is likely to be reduced by more than # 0.1, NoGo if it is likely not to be reduced criterion_posterior(theta_tv = -0.1, theta_mav = 0, gamma_go = 0.6, gamma_nogo = 0.7, direction = "less") # Efficacy (larger is better) and safety (smaller is better) endpoints criterion_posterior(theta_tv = c(0.2, -0.1), theta_mav = c(0.1, 0), gamma_go = 0.5, gamma_nogo = 0.5, direction = c("greater", "less"))# One endpoint criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) # Two endpoints criterion_posterior(theta_tv = c(0.2, 0.15), theta_mav = c(0.1, 0.05), gamma_go = 0.3, gamma_nogo = 0.4) # Two endpoints, marginal criteria combined with AND criterion_posterior(theta_tv = c(0.2, 0.15), theta_mav = c(0.1, 0.05), gamma_go = c(0.6, 0.5), gamma_nogo = 0.7, rule = "and") # Rate of an adverse event: Go if it is likely to be reduced by more than # 0.1, NoGo if it is likely not to be reduced criterion_posterior(theta_tv = -0.1, theta_mav = 0, gamma_go = 0.6, gamma_nogo = 0.7, direction = "less") # Efficacy (larger is better) and safety (smaller is better) endpoints criterion_posterior(theta_tv = c(0.2, -0.1), theta_mav = c(0.1, 0), gamma_go = 0.5, gamma_nogo = 0.5, direction = c("greater", "less"))
Specifies a Go/NoGo decision criterion based on the posterior predictive
probability of the treatment effect that will be
observed in a future study with m_t and m_c subjects in the
treatment and control groups, given the proof-of-concept data .
The future effect is the difference between the future sample proportions
(binary endpoints) or sample means (continuous endpoints), or, for a
time-to-event endpoint, the difference of the estimated milestone survival
probabilities or the ratio of the estimated hazards (see
design_tte).
criterion_predictive( theta_null, m_t, m_c = m_t, gamma_go, gamma_nogo, go_regions = 1L, nogo_regions = 4L, rule = c("joint", "and", "or"), direction = "greater" )criterion_predictive( theta_null, m_t, m_c = m_t, gamma_go, gamma_nogo, go_regions = 1L, nogo_regions = 4L, rule = c("joint", "and", "or"), direction = "greater" )
theta_null |
Null value of the treatment effect in the future study: a number for one endpoint or a numeric vector of length 2 for two endpoints. |
m_t, m_c
|
Numbers of subjects in the treatment and control groups of the future study (whole numbers of at least 1). |
gamma_go |
Probability threshold for the Go criterion, strictly
between 0 and 1. With |
gamma_nogo |
Probability threshold for the NoGo criterion, strictly
between 0 and 1, given in the same way as |
go_regions |
Region numbers (from 1 to 4) forming the Go region for two
endpoints with |
nogo_regions |
Region numbers (from 1 to 4) forming the NoGo region for
two endpoints with |
rule |
For two endpoints, |
direction |
|
For one endpoint, the Go region is and
the NoGo region is . The Go criterion
is and the
NoGo criterion is
. Because
the two probabilities add up to 1, a Gray decision is possible only when
, and Miss decisions can occur only when
.
With direction = "less", for an endpoint on which smaller effects
are favorable, the Go region is and the
NoGo region is .
For two endpoints, the null values divide the plane of
into four regions (see
qdm_regions), and the criteria are based on the predictive
probabilities of the unions of go_regions and nogo_regions
(Yamaguchi et al., submitted, equations 7 and 8). With rule = "and"
or "or", they are based on the marginal predictive probabilities of
each endpoint, for Go
and for NoGo,
combined with AND or OR (equations 9 and 10). With two endpoints,
direction can differ between the endpoints, and the regions are
defined on the favorable side of each endpoint.
An object of class
c("qdm_criterion_predictive", "qdm_criterion").
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
Other criteria:
criterion_posterior()
criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7) # Smaller effects are favorable criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7, direction = "less")criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7) # Smaller effects are favorable criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7, direction = "less")
Summarizes the data of one group for a single binary endpoint as the number of subjects and the number of responders. Used for observed proof-of-concept data, external data and hypothetical control data.
data_binary(n, y)data_binary(n, y)
n |
Number of subjects (a whole number of at least 1). |
y |
Number of responders (a whole number from 0 to |
An object of class c("qdm_data_binary", "qdm_data") with
integer elements n and y.
Other data:
data_binary2(),
data_continuous(),
data_continuous2(),
data_tte()
data_binary(n = 12, y = 7)data_binary(n = 12, y = 7)
Summarizes the data of one group for two binary endpoints by the counts of the four joint response patterns.
data_binary2(counts)data_binary2(counts)
counts |
A numeric vector of four non-negative whole numbers in the
cell order |
The cells are ordered as "00", "01", "10" and
"11", where the first digit is the response on endpoint 1 and the
second digit is the response on endpoint 2 (1 = response, 0 = no
response).
An object of class c("qdm_data_binary2", "qdm_data") with
elements n (the total count) and counts (a named integer
vector of length 4).
Other data:
data_binary(),
data_continuous(),
data_continuous2(),
data_tte()
data_binary2(c(4, 2, 3, 6))data_binary2(c(4, 2, 3, 6))
Summarizes the data of one group for a single continuous endpoint by its
sufficient statistics: the number of subjects, the sample mean and the
sample standard deviation (with divisor n - 1).
data_continuous(n, mean, sd)data_continuous(n, mean, sd)
n |
Number of subjects (a whole number of at least 2). |
mean |
Sample mean. |
sd |
Sample standard deviation (positive). |
An object of class c("qdm_data_continuous", "qdm_data") with
elements n, mean and sd.
Other data:
data_binary(),
data_binary2(),
data_continuous2(),
data_tte()
data_continuous(n = 12, mean = 3.2, sd = 2.0)data_continuous(n = 12, mean = 3.2, sd = 2.0)
Summarizes the data of one group for two continuous endpoints by their
sufficient statistics: the number of subjects, the vector of sample means
and the sample covariance matrix (with divisor n - 1).
data_continuous2(n, mean, cov)data_continuous2(n, mean, cov)
n |
Number of subjects (a whole number of at least 3). |
mean |
Numeric vector of length 2, the sample means of endpoints 1 and 2. |
cov |
A 2 x 2 symmetric positive definite sample covariance matrix. |
An object of class c("qdm_data_continuous2", "qdm_data")
with elements n, mean and cov.
Other data:
data_binary(),
data_binary2(),
data_continuous(),
data_tte()
data_continuous2(n = 12, mean = c(3.2, 1.5), cov = matrix(c(4, 1.2, 1.2, 2), nrow = 2))data_continuous2(n = 12, mean = c(3.2, 1.5), cov = matrix(c(4, 1.2, 1.2, 2), nrow = 2))
Summarizes the data of one group for a time-to-event endpoint by the sufficient statistics of the exponential model: the number of events and the total observed time (the sum over subjects of the time from entry to the event or censoring). Used for observed proof-of-concept data, external data and hypothetical control data.
data_tte(events, exposure)data_tte(events, exposure)
events |
Number of events (a whole number of at least 0). |
exposure |
Total observed time (positive), in the same unit as the milestone time of the design. |
With exponential event times and independent censoring, the likelihood of
the hazard is proportional to
for events and total observed
time , so these two numbers are all that the analysis needs.
An object of class c("qdm_data_tte", "qdm_data") with
elements events and exposure.
Other data:
data_binary(),
data_binary2(),
data_continuous(),
data_continuous2()
data_tte(events = 5, exposure = 40)data_tte(events = 5, exposure = 40)
Specifies a proof-of-concept study with one binary endpoint: the sample
sizes, the prior distributions, the external data, the form of the control
group and the decision criterion. The design is used by
qdm_decide, qdm_oc and
qdm_calibrate.
design_binary( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL )design_binary( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL )
n_t |
Number of subjects in the treatment group (a whole number of at least 1). |
n_c |
Number of subjects in the concurrent control group (a whole number of at least 0). |
prior_t, prior_c
|
Beta prior distributions of the response rates of
the treatment and control groups, created by |
criterion |
Decision criterion for one endpoint, created by
|
external_t, external_c
|
External data of the treatment and control
groups, created by |
hypothetical_c |
Hypothetical control, created by
|
fixed_c |
Fixed control response rate, a number from 0 to 1, or
|
The response rates and of the treatment and control
groups have Beta prior distributions, and the treatment effect is
. The control group takes one of four forms.
n_c is at least 1. External control data
can be added through external_c.
n_c = 0 and external_c is
given. The distribution of is the posterior distribution
given the external control data.
n_c = 0 and hypothetical_c is
given. The distribution of is the posterior distribution
given the hypothetical control data. The hypothetical control
of
Kang et al. (2026, Section 4.1.4) is obtained with prior_c equal
to prior_t and hypothetical(data_binary(n_t, z)).
n_c = 0 and fixed_c is given: the
control response rate is a known value , as in a single-arm
study compared with a benchmark. The posterior probabilities are
and
, computed from the
Beta posterior distribution of (with the inequalities
reversed for direction = "less"). For the posterior
predictive criterion the future effect is ,
where follows the Beta-binomial posterior predictive
distribution (a future effect that differs from the null value by less
than is treated as equal to it); m_c is not used.
prior_c is not used and must be NULL.
External treatment data (external_t) can be used with any form of
the control group. External data enter through a power prior: with
external data of subjects and responders and weight
, the posterior distribution of the response rate is
.
An object of class c("qdm_design_binary", "qdm_design"), a
list with the arguments and the element control
("concurrent", "external", "hypothetical" or
"fixed").
Kang, R., Yamaguchi, Y. and Han, C. (2026). Bayesian quantitative decision-making framework in cell and gene therapy development for rare diseases. Journal of Biopharmaceutical Statistics. doi:10.1080/10543406.2026.2655410
Other designs:
design_binary2(),
design_continuous(),
design_continuous2(),
design_tte()
# Concurrent control with external control data design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8), external_c = borrow(data_binary(n = 20, y = 8), a0 = 0.5) ) # Uncontrolled study with a hypothetical control design_binary( n_t = 12, n_c = 0, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7), hypothetical_c = hypothetical(data = data_binary(n = 12, y = 4)) ) # Single-arm study compared with a fixed control response rate of 0.2 design_binary( n_t = 20, n_c = 0, prior_t = prior_beta(1, 1), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.05, gamma_go = 0.8, gamma_nogo = 0.8), fixed_c = 0.2 )# Concurrent control with external control data design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8), external_c = borrow(data_binary(n = 20, y = 8), a0 = 0.5) ) # Uncontrolled study with a hypothetical control design_binary( n_t = 12, n_c = 0, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7), hypothetical_c = hypothetical(data = data_binary(n = 12, y = 4)) ) # Single-arm study compared with a fixed control response rate of 0.2 design_binary( n_t = 20, n_c = 0, prior_t = prior_beta(1, 1), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.05, gamma_go = 0.8, gamma_nogo = 0.8), fixed_c = 0.2 )
Specifies a proof-of-concept study with two binary endpoints: the sample
sizes, the Dirichlet prior distributions, the external data, the form of
the control group, the decision criterion for two endpoints and the
computation settings. The design is used by qdm_decide,
qdm_oc and qdm_calibrate.
design_binary2( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, nMC = 10000L, enumerate = TRUE )design_binary2( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, nMC = 10000L, enumerate = TRUE )
n_t |
Number of subjects in the treatment group (a whole number of at least 1). |
n_c |
Number of subjects in the concurrent control group (a whole number of at least 0). |
prior_t, prior_c
|
Dirichlet prior distributions of the four cell
probabilities of the treatment and control groups, created by
|
criterion |
Decision criterion for two endpoints, created by
|
external_t, external_c
|
External data of the treatment and control
groups, created by |
hypothetical_c |
Hypothetical control, created by
|
fixed_c |
Fixed control response rates of endpoints 1 and 2, a numeric
vector of length 2 with values from 0 to 1, or |
nMC |
Number of Monte Carlo draws for posterior probabilities. |
enumerate |
Logical; if |
The responses of a subject on the two endpoints fall into one of the four
cells "00", "01", "10" and "11" (first digit:
endpoint 1), whose probabilities have Dirichlet prior distributions in each
group (Yamaguchi et al., submitted, Appendix A.1). The treatment effects
are the differences of the marginal response rates,
with and
. External data with counts enter
through a power prior with weight , which adds to the
Dirichlet parameters. The control group takes one of four forms, as in
design_binary: a concurrent control group (n_c of at
least 1), external control data only (n_c = 0 and
external_c), a hypothetical control (n_c = 0 and
hypothetical_c created from data_binary2, whose counts
are added to prior_c; the hypothetical control distribution
Dir(beta) of Yamaguchi et al., Appendix A.1.6, is obtained with
prior_c = prior_dirichlet(beta - counts)), or a fixed control
(n_c = 0 and fixed_c, the known response rates of the two
endpoints in the control group; prior_c must then be NULL).
With a fixed control, the posterior probabilities are estimated from draws
of the treatment distribution only, and the future effects of the
predictive criterion are (a future effect
that differs from the null value by less than is treated as
equal to it; m_c is not used).
The posterior probabilities of the regions (posterior criteria) are
estimated by Monte Carlo simulation with nMC draws from the
Dirichlet posterior distributions. The posterior predictive probabilities
(predictive criteria) are computed exactly: the future effects depend only
on the numbers of responders on each endpoint, whose joint distribution in
each group is obtained from the Dirichlet-multinomial distribution, and a
future effect equal to a null value is not counted as larger.
For qdm_oc and qdm_calibrate, with
enumerate = TRUE all outcomes of the study are enumerated: there are
choose(n + 3, 3) outcomes in a group of n subjects (286 for
n = 10), and the probabilities of the regions are computed for
every pair of treatment and control outcomes, with the same Monte Carlo
draws for all pairs. For a posterior criterion the computing time is
proportional to the number of pairs times nMC, and enumeration is
limited to 1e7 pairs (for example, 24 subjects in each group). With
enumerate = FALSE, nsim studies are simulated under each
scenario, which is faster for large sample sizes.
An object of class c("qdm_design_binary2", "qdm_design"),
a list with the arguments and the element control
("concurrent", "external", "hypothetical" or
"fixed").
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
Other designs:
design_binary(),
design_continuous(),
design_continuous2(),
design_tte()
# Case study 1 of Yamaguchi et al. (submitted), with a small nMC for speed des <- design_binary2( n_t = 10, n_c = 10, prior_t = prior_dirichlet(rep(0.25, 4)), prior_c = prior_dirichlet(rep(0.25, 4)), criterion = criterion_posterior(theta_tv = c(0.15, 0.15), theta_mav = c(0.10, 0.10), gamma_go = 0.263, gamma_nogo = 0.347), nMC = 2000 ) des qdm_decide(des, data_t = data_binary2(c(3, 2, 2, 3)), data_c = data_binary2(c(6, 2, 1, 1)), seed = 1)# Case study 1 of Yamaguchi et al. (submitted), with a small nMC for speed des <- design_binary2( n_t = 10, n_c = 10, prior_t = prior_dirichlet(rep(0.25, 4)), prior_c = prior_dirichlet(rep(0.25, 4)), criterion = criterion_posterior(theta_tv = c(0.15, 0.15), theta_mav = c(0.10, 0.10), gamma_go = 0.263, gamma_nogo = 0.347), nMC = 2000 ) des qdm_decide(des, data_t = data_binary2(c(3, 2, 2, 3)), data_c = data_binary2(c(6, 2, 1, 1)), seed = 1)
Specifies a proof-of-concept study with one normally distributed endpoint:
the sample sizes, the prior distributions, the external data, the form of
the control group, the decision criterion and the method used to compute
the probabilities. The design is used by qdm_decide,
qdm_oc and qdm_calibrate.
design_continuous( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, method = c("NI", "MM", "MC"), nMC = 10000L )design_continuous( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, method = c("NI", "MM", "MC"), nMC = 10000L )
n_t |
Number of subjects in the treatment group (a whole number of at least 2). |
n_c |
Number of subjects in the concurrent control group: 0 (no concurrent control group) or a whole number of at least 2. |
prior_t, prior_c
|
Prior distributions of the mean and variance of the
treatment and control groups, created by |
criterion |
Decision criterion for one endpoint, created by
|
external_t, external_c
|
External data of the treatment and control
groups, created by |
hypothetical_c |
Hypothetical control, created by
|
fixed_c |
Fixed control mean, a number, or |
method |
Method used to compute the probabilities: |
nMC |
Number of Monte Carlo draws for |
The outcomes of group () follow
, and the treatment effect is
. With the Normal-Inverse-chi-squared prior
(prior_nix), the posterior distribution of
is Normal-Inverse-chi-squared with parameters
, and the posterior
distribution of the mean is
. With the vague
prior (prior_vague) and subjects with sample mean
and standard deviation , it is
.
External data enter through a power prior with weight : data with
subjects, mean and standard deviation
are combined with the prior as if they were subjects with the
same mean and the sum of squares . The posterior
distribution then has a closed form (Huang et al., submitted). With the
vague prior and external data, the posterior distribution of the mean has
degrees of freedom.
The control group takes one of four forms.
n_c is at least 2. External control
data can be added through external_c.
n_c = 0 and external_c is
given. The distribution of is the posterior distribution
given the external control data. With the vague prior,
must be greater than 1.
n_c = 0 and hypothetical_c is
given by hypothetical(mean = mu0c, r = r). Following Kang et al.
(2026, Section 4.2.4), the control mean has the same t distribution as
the posterior distribution of the treatment mean, with location
and squared scale multiplied by :
.
prior_c is not used and must be NULL.
n_c = 0 and fixed_c is given: the
control mean is a known value , as in a single-arm study
compared with a benchmark. The probabilities of the Go and NoGo regions
are computed exactly from the t distribution of the treatment mean
(posterior) or of the mean of future subjects (posterior
predictive), shifted by ; method, nMC and
m_c are not used. prior_c is not used and must be
NULL.
For the posterior predictive criterion (criterion_predictive),
the future effect is the difference between the sample means of
and future subjects. The posterior predictive distribution of the
mean of future subjects of a group is
; for a
hypothetical control it is
.
The probabilities of the Go and NoGo regions are probabilities of the
difference of two t variables, computed by ptdiff with the
chosen method. With method = "MC", the probabilities of the
two regions are estimated from the same nMC draws.
An object of class c("qdm_design_continuous", "qdm_design"),
a list with the arguments and the element control
("concurrent", "external", "hypothetical" or
"fixed").
Kang, R., Yamaguchi, Y. and Han, C. (2026). Bayesian quantitative decision-making framework in cell and gene therapy development for rare diseases. Journal of Biopharmaceutical Statistics. doi:10.1080/10543406.2026.2655410
Huang, Y., Yamaguchi, Y., Homma, G., Takeda, K. and Maruo, K. (submitted). Conjugate representation of power priors for efficient Bayesian analysis of normal data.
Other designs:
design_binary(),
design_binary2(),
design_continuous2(),
design_tte()
# Concurrent control with external treatment and control data design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), external_t = borrow(data_continuous(n = 6, mean = 20, sd = 30), a0 = 0.5), external_c = borrow(data_continuous(n = 30, mean = -12, sd = 20), a0 = 0.4) ) # Uncontrolled study with a hypothetical control design_continuous( n_t = 12, n_c = 0, prior_t = prior_vague(), criterion = criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7), hypothetical_c = hypothetical(mean = -10, r = 1), method = "MM" ) # Single-arm study compared with a fixed control mean of -10 design_continuous( n_t = 12, n_c = 0, prior_t = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), fixed_c = -10 )# Concurrent control with external treatment and control data design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), external_t = borrow(data_continuous(n = 6, mean = 20, sd = 30), a0 = 0.5), external_c = borrow(data_continuous(n = 30, mean = -12, sd = 20), a0 = 0.4) ) # Uncontrolled study with a hypothetical control design_continuous( n_t = 12, n_c = 0, prior_t = prior_vague(), criterion = criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7), hypothetical_c = hypothetical(mean = -10, r = 1), method = "MM" ) # Single-arm study compared with a fixed control mean of -10 design_continuous( n_t = 12, n_c = 0, prior_t = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), fixed_c = -10 )
Specifies a proof-of-concept study with two continuous endpoints: the
sample sizes, the prior distributions, the external data, the form of the
control group, the decision criterion for two endpoints and the method
used to compute the probabilities. The design is used by
qdm_decide, qdm_oc and
qdm_calibrate.
design_continuous2( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, method = c("MM", "MC"), nMC = 10000L )design_continuous2( n_t, n_c, prior_t, prior_c = NULL, criterion, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, method = c("MM", "MC"), nMC = 10000L )
n_t |
Number of subjects in the treatment group (a whole number of at least 3). |
n_c |
Number of subjects in the concurrent control group: 0 or a whole number of at least 3. |
prior_t, prior_c
|
Prior distributions of the treatment and control
groups, created by |
criterion |
Decision criterion for two endpoints, created by
|
external_t, external_c
|
External data of the treatment and control
groups, created by |
hypothetical_c |
Hypothetical control, created by
|
fixed_c |
Fixed control means of endpoints 1 and 2, a numeric vector
of length 2, or |
method |
Method used to compute the probabilities: |
nMC |
Number of Monte Carlo draws for |
The responses of a subject on the two endpoints have a bivariate normal
distribution with mean vector and covariance matrix
in group (Yamaguchi et al., submitted, Appendix
A.2). The prior distribution of is
Normal-Inverse-Wishart (prior_niw) or vague
(prior_vague, the density ). External
data enter through a power prior with weight , which has the
conjugate form, and the posterior parameters are updated with the external
data and then with the current data. The vague prior corresponds to
, and , so the
posterior distribution of the mean is
without external data, where
is the matrix of sums of squares and cross-products,
times the sample covariance matrix (Yamaguchi et al., submitted,
equation A.9).
The treatment effects are the differences of the means,
. The mean of each group has a
bivariate t distribution with degrees of freedom,
location and scale matrix
. For a predictive criterion,
the mean of future subjects has the same distribution with the
scale matrix ,
because the future subjects share the same mean and covariance matrix
(version 0.1.0 and Yamaguchi et al. used the scale matrix
, which treats
them as independent draws from the predictive distribution of one
subject). A hypothetical control (hypothetical(mean = c(m1, m2),
r = r)) gives the control mean the distribution of the treatment mean
with location mean and the scale matrix multiplied by r
(Yamaguchi et al., Section A.2.6, with the hyperparameters of the
treatment group). With external control data only (n_c = 0 and
external_c) and the vague prior, must be greater
than 2. A fixed control (n_c = 0 and fixed_c, the known
control means of the two endpoints) shifts the distribution of the
treatment mean, so the effect has a bivariate t distribution and the
probabilities of the regions are computed exactly from its distribution
function; method, nMC and m_c are then not used,
and prior_c must be NULL.
The probabilities of the regions are computed by one of two methods:
"MM"moment-matching approximation: the effect is approximated by a bivariate t distribution with the same mean, covariance matrix and radial fourth moment (Yamaguchi, Homma, Takeda and Maruo, submitted, Theorem 3), whose rectangle probabilities are computed by numerical integration for real degrees of freedom. It requires more than 4 degrees of freedom for both groups and is the fastest method.
"MC"Monte Carlo simulation with nMC draws from
each distribution; the probabilities of all regions are estimated
from the same draws. The computing time is proportional to
nMC, so "MM" is much faster for operating
characteristics, which need the probabilities for many simulated
studies.
The operating characteristics are computed by simulating the sample means
and the sums of squares and cross-products of nsim studies (see
qdm_oc).
An object of class c("qdm_design_continuous2",
"qdm_design"), a list with the arguments and the element
control ("concurrent", "external",
"hypothetical" or "fixed").
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
Yamaguchi, Y., Homma, G., Takeda, K. and Maruo, K. (submitted). Moment-matching approximation for t-differences in clinical trials with continuous endpoints.
Other designs:
design_binary(),
design_binary2(),
design_continuous(),
design_tte()
# Case study 2 of Yamaguchi et al. (submitted) L0 <- matrix(c(80^2, 15, 15, 6^2), 2, 2) des <- design_continuous2( n_t = 30, n_c = 30, prior_t = prior_niw(mu0 = c(0, 1), kappa0 = 0.1, nu0 = 4, Lambda0 = L0), prior_c = prior_niw(mu0 = c(-10, -1), kappa0 = 0.1, nu0 = 4, Lambda0 = L0), criterion = criterion_posterior(theta_tv = c(10, 2), theta_mav = c(5, 1), gamma_go = 0.296, gamma_nogo = 0.244) ) des qdm_decide(des, data_t = data_continuous2(30, c(5, 2), matrix(c(6400, 190, 190, 36), 2, 2)), data_c = data_continuous2(30, c(-10, -1), matrix(c(5600, 150, 150, 42), 2, 2)))# Case study 2 of Yamaguchi et al. (submitted) L0 <- matrix(c(80^2, 15, 15, 6^2), 2, 2) des <- design_continuous2( n_t = 30, n_c = 30, prior_t = prior_niw(mu0 = c(0, 1), kappa0 = 0.1, nu0 = 4, Lambda0 = L0), prior_c = prior_niw(mu0 = c(-10, -1), kappa0 = 0.1, nu0 = 4, Lambda0 = L0), criterion = criterion_posterior(theta_tv = c(10, 2), theta_mav = c(5, 1), gamma_go = 0.296, gamma_nogo = 0.244) ) des qdm_decide(des, data_t = data_continuous2(30, c(5, 2), matrix(c(6400, 190, 190, 36), 2, 2)), data_c = data_continuous2(30, c(-10, -1), matrix(c(5600, 150, 150, 42), 2, 2)))
Specifies a proof-of-concept study with one time-to-event endpoint
evaluated by the milestone survival probability or by the hazard ratio:
the sample sizes, the prior distributions, the external data, the form of
the control group, the decision criterion, the effect measure and the
conduct of the study.
The design is used by qdm_decide, qdm_oc,
qdm_calibrate and qdm_boundary.
design_tte( n_t, n_c, prior_t, prior_c = NULL, criterion, milestone = NULL, effect = c("milestone", "hazard_ratio"), conduct = NULL, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, conduct_future = conduct, nMC = 10000L )design_tte( n_t, n_c, prior_t, prior_c = NULL, criterion, milestone = NULL, effect = c("milestone", "hazard_ratio"), conduct = NULL, external_t = NULL, external_c = NULL, hypothetical_c = NULL, fixed_c = NULL, conduct_future = conduct, nMC = 10000L )
n_t |
Number of subjects in the treatment group (a whole number of at least 1). |
n_c |
Number of subjects in the concurrent control group (a whole number of at least 0). |
prior_t, prior_c
|
Gamma prior distributions of the hazards of the
treatment and control groups, created by |
criterion |
Decision criterion for one endpoint, created by
|
milestone |
Milestone time |
effect |
Effect measure: |
conduct |
Conduct of the study, created by |
external_t, external_c
|
External data of the treatment and control
groups, created by |
hypothetical_c |
Hypothetical control, created by
|
fixed_c |
Fixed control milestone survival probability, a number from
0 to 1 ( |
conduct_future |
Conduct of the future study for a predictive
criterion, created by |
nMC |
Number of simulated future studies for posterior predictive probabilities. |
The event times of group () are exponential with
hazard , which has a Gamma prior distribution
(prior_gamma). The data of a group are summarized by the
number of events and the total observed time
(data_tte), and the posterior distribution of the hazard is
Gamma with shape and rate . External data enter
through a power prior with weight , which adds to the
shape and to the rate. The treatment effect is either
effect = "milestone"the difference of the milestone
survival probabilities at time milestone,
with
, or
effect = "hazard_ratio"the hazard ratio
, as in Huang et al. (2019), whose
decision rules are based on the normal approximation of the estimated
log hazard ratio. Smaller hazard ratios are favorable, so the
criterion is usually specified with direction = "less", for
example theta_tv = 0.67 and theta_mav = 0.8. Under the
exponential model the hazard ratio is also the ratio of the median
survival times of the control and treatment groups.
The control group takes one of four forms.
n_c is at least 1. External control
data can be added through external_c.
n_c = 0 and external_c is
given. The distribution of is the posterior
distribution given the external control data.
n_c = 0 and hypothetical_c is
given by hypothetical(data_tte(events, exposure)), whose events
and total observed time are added to prior_c.
n_c = 0 and fixed_c is given: the
control milestone survival probability (effect = "milestone")
or the control median survival time (effect = "hazard_ratio",
control hazard / fixed_c) is a known value, as
in a single-arm study compared with a benchmark (with the milestone
survival, fixed_c = 0 makes the effect the treatment milestone
survival itself). prior_c is not used and must be
NULL.
Posterior probabilities of the Go and NoGo regions are computed exactly
for a fixed control (from the Gamma distribution of ). With
another control, they are computed by numerical integration for the
milestone survival (see psurvdiff) and exactly from the F
distribution for the hazard ratio (see phazardratio).
For the posterior predictive criterion (criterion_predictive),
a future study with m_t treatment and m_c control subjects
(no control group for a fixed control) is conducted as specified by
conduct_future. The hazard of each group in the future study is
estimated by , the posterior mean of the hazard
given the future data alone with the prior of the group
(prior_t or prior_c); with a weak prior this is close to the
maximum likelihood estimate and, unlike it, is positive when a
group has no events, so that the hazard ratio is defined. The milestone
survival is estimated by . The future
effect is the difference
of the two milestone survival estimates (or the treatment estimate minus
the fixed value), or the ratio of the two hazard estimates (or the
treatment estimate divided by the fixed control hazard). The predictive
probabilities are estimated by simulating nMC future studies,
each with hazards drawn from the posterior
distributions given the proof-of-concept data (see
conduct_tte for the simulation of a study). They are
therefore Monte Carlo estimates, and their computing time is proportional
to nMC times the number of future subjects.
The operating characteristics (qdm_oc,
qdm_calibrate) are computed by simulating nsim
studies conducted as specified by conduct, with exponential event
times whose hazards are given by the median survival times of the
scenarios. With a predictive criterion, every simulated study requires
nMC simulated future studies, so small values of nsim and
nMC are advisable for exploration.
An object of class c("qdm_design_tte", "qdm_design"), a
list with the arguments and the element control
("concurrent", "external", "hypothetical" or
"fixed").
Huang, B., Talukder, E., Han, L. and Kuan, P.-F. (2019). Quantitative decision-making in randomized Phase II studies with a time-to-event endpoint. Journal of Biopharmaceutical Statistics, 29(1), 189–202. doi:10.1080/10543406.2018.1489400
Other designs:
design_binary(),
design_binary2(),
design_continuous(),
design_continuous2()
# Single-arm study compared with a fixed control 3-month survival of 0.72 des <- design_tte( n_t = 30, n_c = 0, prior_t = prior_gamma(0.1, 1), criterion = criterion_posterior(theta_tv = 0.15, theta_mav = 0, gamma_go = 0.6, gamma_nogo = 0.8), milestone = 3, conduct = conduct_tte(accrual_time = c(0, 5, 10, 15), accrual_rate = c(0.4, 2, 4.5), dropout_hazard = 0.00226, cut_time = 15.44), fixed_c = 0.72 ) des qdm_decide(des, data_t = data_tte(events = 6, exposure = 150)) # Concurrent control design_tte( n_t = 30, n_c = 30, prior_t = prior_gamma(0.1, 1), prior_c = prior_gamma(0.1, 1), criterion = criterion_posterior(theta_tv = 0.15, theta_mav = 0, gamma_go = 0.6, gamma_nogo = 0.8), milestone = 3, conduct = conduct_tte(accrual_time = c(0, 12), cut_events = 25) ) # Hazard ratio in the randomized study of the example of Huang et al. # (2019) (2:1 randomization, analysis at 127 events): Go if HR < 0.67 # with probability at least 0.5, NoGo if HR >= 0.8 with probability at # least 0.6 design_tte( n_t = 112, n_c = 56, prior_t = prior_gamma(0.01, 0.01), prior_c = prior_gamma(0.01, 0.01), criterion = criterion_posterior(theta_tv = 0.67, theta_mav = 0.8, gamma_go = 0.5, gamma_nogo = 0.6, direction = "less"), effect = "hazard_ratio", conduct = conduct_tte(accrual_time = c(0, 13), dropout_hazard = 0.003, cut_events = 127) )# Single-arm study compared with a fixed control 3-month survival of 0.72 des <- design_tte( n_t = 30, n_c = 0, prior_t = prior_gamma(0.1, 1), criterion = criterion_posterior(theta_tv = 0.15, theta_mav = 0, gamma_go = 0.6, gamma_nogo = 0.8), milestone = 3, conduct = conduct_tte(accrual_time = c(0, 5, 10, 15), accrual_rate = c(0.4, 2, 4.5), dropout_hazard = 0.00226, cut_time = 15.44), fixed_c = 0.72 ) des qdm_decide(des, data_t = data_tte(events = 6, exposure = 150)) # Concurrent control design_tte( n_t = 30, n_c = 30, prior_t = prior_gamma(0.1, 1), prior_c = prior_gamma(0.1, 1), criterion = criterion_posterior(theta_tv = 0.15, theta_mav = 0, gamma_go = 0.6, gamma_nogo = 0.8), milestone = 3, conduct = conduct_tte(accrual_time = c(0, 12), cut_events = 25) ) # Hazard ratio in the randomized study of the example of Huang et al. # (2019) (2:1 randomization, analysis at 127 events): Go if HR < 0.67 # with probability at least 0.5, NoGo if HR >= 0.8 with probability at # least 0.6 design_tte( n_t = 112, n_c = 56, prior_t = prior_gamma(0.01, 0.01), prior_c = prior_gamma(0.01, 0.01), criterion = criterion_posterior(theta_tv = 0.67, theta_mav = 0.8, gamma_go = 0.5, gamma_nogo = 0.6, direction = "less"), effect = "hazard_ratio", conduct = conduct_tte(accrual_time = c(0, 13), dropout_hazard = 0.003, cut_events = 127) )
Format an external data specification
## S3 method for class 'qdm_borrow' format(x, digits = 4L, ...)## S3 method for class 'qdm_borrow' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character string describing the external data and the power prior weight.
format(borrow(data_binary(n = 20, y = 8), a0 = 0.5))format(borrow(data_binary(n = 20, y = 8), a0 = 0.5))
Formats the decision intervals of qdm_boundary as tables
with one row per condition and one column per decision: the range of the
observed quantity (numbers of responders or events, or observed means),
and the corresponding observed response rates (binary endpoint) or
milestone survival probabilities (time-to-event endpoint) and observed
treatment effects.
## S3 method for class 'qdm_boundary' format(x, digits = 4L, n = 20L, ...)## S3 method for class 'qdm_boundary' format(x, digits = 4L, n = 20L, ...)
x |
An object of class |
digits |
Number of significant digits for observed means, milestone survival probabilities, effects and conditions. |
n |
Maximum number of conditions shown in each table. |
... |
Not used. |
A character vector with one element per line of the tables
(print.qdm_boundary prints them). For rows subset from
the object, which no longer have its attributes, the formatted data
frame.
des <- design_binary( n_t = 20, n_c = 0, prior_t = prior_beta(1, 1), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.05, gamma_go = 0.8, gamma_nogo = 0.8), fixed_c = 0.2 ) format(qdm_boundary(des, n_t = c(10, 20)))des <- design_binary( n_t = 20, n_c = 0, prior_t = prior_beta(1, 1), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.05, gamma_go = 0.8, gamma_nogo = 0.8), fixed_c = 0.2 ) format(qdm_boundary(des, n_t = c(10, 20)))
Format a calibration
## S3 method for class 'qdm_calibration' format(x, digits = 4L, ...)## S3 method for class 'qdm_calibration' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character vector with one element per line of the description (without the table of decision probabilities).
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) format(qdm_calibrate(des, data.frame(pi_t = 0.4, pi_c = 0.4), data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) format(qdm_calibrate(des, data.frame(pi_t = 0.4, pi_c = 0.4), data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2))
Format the conduct of a study
## S3 method for class 'qdm_conduct' format(x, digits = 4L, ...)## S3 method for class 'qdm_conduct' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character vector with one element per line of the description.
format(conduct_tte(accrual_time = c(0, 12), cut_events = 20))format(conduct_tte(accrual_time = c(0, 12), cut_events = 20))
Format a decision criterion
## S3 method for class 'qdm_criterion' format(x, digits = 4L, ...)## S3 method for class 'qdm_criterion' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character vector with one element per line of the description.
format(criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8))format(criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8))
Format a data specification
## S3 method for class 'qdm_data' format(x, digits = 4L, ...)## S3 method for class 'qdm_data' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character string describing the data.
format(data_binary(n = 12, y = 7))format(data_binary(n = 12, y = 7))
Format a decision
## S3 method for class 'qdm_decision' format(x, digits = 4L, ...)## S3 method for class 'qdm_decision' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character vector with one element per line of the description.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) format(qdm_decide(des, data_binary(12, 9), data_binary(12, 4)))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) format(qdm_decide(des, data_binary(12, 9), data_binary(12, 4)))
Format a design
## S3 method for class 'qdm_design' format(x, digits = 4L, ...)## S3 method for class 'qdm_design' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character vector with one element per line of the description.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) format(des)des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) format(des)
Format a hypothetical control specification
## S3 method for class 'qdm_hypothetical' format(x, digits = 4L, ...)## S3 method for class 'qdm_hypothetical' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character string describing the hypothetical control.
format(hypothetical(mean = 1, r = 1))format(hypothetical(mean = 1, r = 1))
Format a prior specification
## S3 method for class 'qdm_prior' format(x, digits = 4L, ...)## S3 method for class 'qdm_prior' format(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
A character string describing the prior distribution.
format(prior_beta(0.5, 0.5))format(prior_beta(0.5, 0.5))
Specifies the distribution of a hypothetical control group, used when the proof-of-concept study has no concurrent control group (Kang et al., 2026).
hypothetical(data = NULL, mean = NULL, r = NULL)hypothetical(data = NULL, mean = NULL, r = NULL)
data |
Hypothetical control data created by
|
mean |
Location of the hypothetical control mean, a number for one continuous endpoint or a numeric vector of length 2 for two continuous endpoints. |
r |
Positive ratio of the squared scale of the hypothetical control to that of the treatment group (continuous endpoints). |
For binary and time-to-event endpoints, give data: the
hypothetical control data are combined with the prior of the control
group, for example
for one binary endpoint, or a Gamma distribution of the hazard with shape
and rate for events in the total
observed time . For continuous endpoints, give mean and r: the
control mean has the same t distribution as the posterior distribution of
the treatment mean, with location mean and squared scale multiplied
by r, that is
.
An object of class "qdm_hypothetical" with elements
type ("data" or "location"), data,
mean and r.
Kang, R., Yamaguchi, Y. and Han, C. (2026). Bayesian quantitative decision-making framework in cell and gene therapy development for rare diseases. Journal of Biopharmaceutical Statistics. doi:10.1080/10543406.2026.2655410
# Binary endpoint: 5 responders out of 15 hypothetical control subjects hypothetical(data = data_binary(n = 15, y = 5)) # Continuous endpoint: control mean located at 1 with the same scale hypothetical(mean = 1, r = 1) # Time-to-event endpoint: 8 events in a total observed time of 60 hypothetical(data = data_tte(events = 8, exposure = 60))# Binary endpoint: 5 responders out of 15 hypothetical control subjects hypothetical(data = data_binary(n = 15, y = 5)) # Continuous endpoint: control mean located at 1 with the same scale hypothetical(mean = 1, r = 1) # Time-to-event endpoint: 8 events in a total observed time of 60 hypothetical(data = data_tte(events = 8, exposure = 60))
Computes (or the upper tail
) for independent
and
. This is the posterior
predictive probability for the difference in response proportions of a
future study with and subjects.
pbetabinomdiff(q, m_t, a_t, b_t, m_c, a_c, b_c, lower.tail = TRUE)pbetabinomdiff(q, m_t, a_t, b_t, m_c, a_c, b_c, lower.tail = TRUE)
q |
Numeric vector of quantiles. |
m_t, m_c
|
Numbers of future subjects in the treatment and control groups (whole numbers of at least 1). |
a_t, b_t
|
Positive shape parameters of the treatment group. |
a_c, b_c
|
Positive shape parameters of the control group. |
lower.tail |
Logical; if |
The probability is an exact finite sum. The probability mass functions are
computed on the log scale, so large values of and do not
cause overflow. Each difference is compared with q after a single
division of the exact integer numerator by
, so differences that are mathematically equal to a decimal
q are classified correctly (they belong to the lower tail).
A numeric vector of probabilities. The arguments q,
a_t, b_t, a_c and b_c are recycled to a common
length; each must have length 1 or the common length.
Other distributions:
cellprob_binary2(),
pbetadiff(),
phazardratio(),
psurvdiff(),
ptdiff(),
rdirichlet()
# Predictive probability that the future difference exceeds 0, with # Jeffreys priors, 7/12 versus 4/12 responders and 20 future subjects per # group pbetabinomdiff(0, m_t = 20, a_t = 7.5, b_t = 5.5, m_c = 20, a_c = 4.5, b_c = 8.5, lower.tail = FALSE)# Predictive probability that the future difference exceeds 0, with # Jeffreys priors, 7/12 versus 4/12 responders and 20 future subjects per # group pbetabinomdiff(0, m_t = 20, a_t = 7.5, b_t = 5.5, m_c = 20, a_c = 4.5, b_c = 8.5, lower.tail = FALSE)
Computes (or the upper tail
) for independent
and
. This is the posterior probability
used for a single binary endpoint.
pbetadiff(q, a_t, b_t, a_c, b_c, lower.tail = TRUE)pbetadiff(q, a_t, b_t, a_c, b_c, lower.tail = TRUE)
q |
Numeric vector of quantiles. |
a_t, b_t
|
Positive shape parameters of the treatment group. |
a_c, b_c
|
Positive shape parameters of the control group. |
lower.tail |
Logical; if |
The upper tail is computed as
where the integral runs over the values of with
, and the first term is zero for
. The integral is evaluated by adaptive Gauss-Kronrod
quadrature (the QUADPACK routine used by integrate),
with the range split at quantiles of both Beta distributions so that
concentrated distributions are integrated accurately. When the density of
is unbounded at 0 () or at 1 (), the
integral on that side of the median of is evaluated in the
variable or , in which the
integrand is bounded. The lower tail is
computed directly from the same formula with the roles of the two groups
exchanged, so both tails are accurate near 0.
A numeric vector of probabilities. All arguments except
lower.tail are recycled to a common length; each must have length
1 or the common length.
Other distributions:
cellprob_binary2(),
pbetabinomdiff(),
phazardratio(),
psurvdiff(),
ptdiff(),
rdirichlet()
# Posterior probability that the response rate difference exceeds 0.1, # with Jeffreys priors and 7/12 versus 4/12 responders pbetadiff(0.1, a_t = 7.5, b_t = 5.5, a_c = 4.5, b_c = 8.5, lower.tail = FALSE)# Posterior probability that the response rate difference exceeds 0.1, # with Jeffreys priors and 7/12 versus 4/12 responders pbetadiff(0.1, a_t = 7.5, b_t = 5.5, a_c = 4.5, b_c = 8.5, lower.tail = FALSE)
Computes (or the upper tail
) for hazards with independent Gamma
distributions, and
(shape and rate). This is the
posterior probability used for a time-to-event endpoint evaluated by the
hazard ratio with a concurrent, external or hypothetical control.
phazardratio(q, shape_t, rate_t, shape_c, rate_c, lower.tail = TRUE)phazardratio(q, shape_t, rate_t, shape_c, rate_c, lower.tail = TRUE)
q |
Numeric vector of quantiles (hazard ratios). |
shape_t, rate_t
|
Positive shape and rate of the treatment hazard. |
shape_c, rate_c
|
Positive shape and rate of the control hazard. |
lower.tail |
Logical; if |
Because has the chi-squared distribution with
degrees of freedom, has the F distribution with and
degrees of freedom, and
which is computed exactly by pf.
A numeric vector of probabilities. All arguments except
lower.tail are recycled to a common length; each must have length
1 or the common length.
Other distributions:
cellprob_binary2(),
pbetabinomdiff(),
pbetadiff(),
psurvdiff(),
ptdiff(),
rdirichlet()
# Posterior probability that the hazard ratio is below 0.7 with 20 events # in 300 months of follow-up versus 30 events in 250 months (Gamma(0.1, 1) # priors) phazardratio(0.7, shape_t = 20.1, rate_t = 301, shape_c = 30.1, rate_c = 251)# Posterior probability that the hazard ratio is below 0.7 with 20 events # in 300 months of follow-up versus 30 events in 250 months (Gamma(0.1, 1) # priors) phazardratio(0.7, shape_t = 20.1, rate_t = 301, shape_c = 30.1, rate_c = 251)
Draws the decision intervals computed by qdm_boundary as
regions filled by the decision (Go, NoGo, Gray, or Miss if it occurs):
the horizontal axis is the condition (for example, the number of control
responders or the treatment group size) and the vertical axis is the
observed quantity (numbers of responders or events, or the observed
treatment mean) or, for continuous endpoints with a concurrent control
group, the observed difference in means. The boundary values are
written on the Go and NoGo regions next to the boundaries, for example
the smallest number of responders that leads to a Go decision. With a
concurrent control group and a binary endpoint, the observed response
rate of the treatment group is shown on a secondary axis.
## S3 method for class 'qdm_boundary' plot( x, col_go = "#658D1B", col_nogo = "#D91E49", col_gray = "#939597", col_miss = "#E69F00", labels = TRUE, label_size = NULL, base_size = 11, legend_position = "bottom", ... )## S3 method for class 'qdm_boundary' plot( x, col_go = "#658D1B", col_nogo = "#D91E49", col_gray = "#939597", col_miss = "#E69F00", labels = TRUE, label_size = NULL, base_size = 11, legend_position = "bottom", ... )
x |
An object of class |
col_go, col_nogo, col_gray, col_miss
|
Colors of the Go, NoGo, Gray and Miss decisions: color names or hexadecimal codes. The defaults are green, red, gray and orange. Transparency (an alpha value in the code) is not used in the heat maps. |
labels |
|
label_size |
Size of the boundary values, in millimeters, or
|
base_size |
Base font size of |
legend_position |
Position of the legend: |
... |
Not used; arguments given here are ignored with a warning. |
The plot is a ggplot object, so it can be changed further by adding
ggplot2 functions, for example ggplot2::labs(),
ggplot2::theme() and ggplot2::scale_fill_manual().
A ggplot object.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) b <- qdm_boundary(des) plot(b) plot(b, labels = c(0, 4, 8), col_gray = "gray80", base_size = 14, legend_position = "right")des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) b <- qdm_boundary(des) plot(b) plot(b, labels = c(0, 4, 8), col_gray = "gray80", base_size = 14, legend_position = "right")
Draws the probability that the Go criterion is met under
scenario_go and the probability that the NoGo criterion is met under
scenario_nogo against the threshold, with the targets (horizontal
lines) and the chosen thresholds (vertical lines).
## S3 method for class 'qdm_calibration' plot( x, col_go = "#658D1B", col_nogo = "#D91E49", linewidth = 1, base_size = 11, legend_position = "bottom", ... )## S3 method for class 'qdm_calibration' plot( x, col_go = "#658D1B", col_nogo = "#D91E49", linewidth = 1, base_size = 11, legend_position = "bottom", ... )
x |
An object of class |
col_go, col_nogo
|
Colors of the curves, targets and thresholds of the Go and NoGo criteria: color names or hexadecimal codes. The defaults are green and red. |
linewidth |
Width of the calibration curves, in the units of the
|
base_size |
Base font size of |
legend_position |
Position of the legend: |
... |
Not used; arguments given here are ignored with a warning. |
The plot is a ggplot object, so it can be changed further by adding
ggplot2 functions, for example ggplot2::labs() and
ggplot2::theme().
A ggplot object.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) cal <- qdm_calibrate(des, data.frame(pi_t = 0.4, pi_c = 0.4), data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2) plot(cal) plot(cal, linewidth = 0.6, base_size = 14, legend_position = "top")des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) cal <- qdm_calibrate(des, data.frame(pi_t = 0.4, pi_c = 0.4), data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2) plot(cal) plot(cal, linewidth = 0.6, base_size = 14, legend_position = "top")
Draws the probabilities of Go, NoGo and Gray decisions (and Miss decisions
if they have positive probability) against the true treatment effect of
the scenarios. For a time-to-event endpoint, the effect is the difference
of the milestone survival probabilities
given by the median survival times of the scenarios. For a design
without a concurrent control group, the horizontal axis is the true
response rate (binary endpoint), mean (continuous endpoint) or milestone
survival probability (time-to-event endpoint) of the treatment group, and
the thresholds of the criterion are shifted by the fixed control value, or
otherwise by the mean (binary and time-to-event) or location (continuous)
of the distribution of the control group. The scenarios must have
distinct values on the horizontal axis, so scenarios with the same effect
(for example, with several standard deviations or control parameters) are
plotted separately.
## S3 method for class 'qdm_oc' plot( x, col_go = "#658D1B", col_nogo = "#D91E49", col_gray = "#939597", col_miss = "#E69F00", linewidth = 1, point_size = 1.5, label_size = NULL, base_size = 11, legend_position = "bottom", overlay = FALSE, cell_values = TRUE, ... )## S3 method for class 'qdm_oc' plot( x, col_go = "#658D1B", col_nogo = "#D91E49", col_gray = "#939597", col_miss = "#E69F00", linewidth = 1, point_size = 1.5, label_size = NULL, base_size = 11, legend_position = "bottom", overlay = FALSE, cell_values = TRUE, ... )
x |
An object of class |
col_go, col_nogo, col_gray, col_miss
|
Colors of the Go, NoGo, Gray and Miss decisions: color names or hexadecimal codes. The defaults are green, red, gray and orange. Transparency (an alpha value in the code) is not used in the heat maps. |
linewidth |
Width of the curves, in the units of the |
point_size |
Size of the points, in millimeters. |
label_size |
Size of the text drawn in the plot, in millimeters: the
labels of the thresholds, or the probabilities in the cells of the heat
maps. |
base_size |
Base font size of |
legend_position |
Position of the legend: |
overlay |
Two endpoints only: |
cell_values |
Two endpoints only: |
... |
Not used; arguments given here are ignored with a warning. |
For two endpoints, the plot has one heat map per decision, with the true
treatment effects of the two endpoints (or the true parameters of the
treatment group without a concurrent control group) on the axes and the
probability of the decision in each cell; scenarios that are not evaluable
are marked "NE". The scenarios must have distinct values on the axes, so
scenarios with several correlations (or several parameters of the control
group) are plotted separately. Each panel is shaded from white
(probability 0) to the color of its decision (probability 1); the heat maps
have no legend. With overlay = TRUE, a single heat map is drawn
instead: each cell has the color of the decision with the highest
probability (Go, Gray or NoGo, or Miss if it occurs; ties go to the first
in this order), shaded in five steps of that probability (below 0.5, 0.5
to 0.6, 0.6 to 0.7, 0.7 to 0.8, and 0.8 or more), with legends for the
decisions and the steps (shown in gray whatever the colors of the
decisions), as in the heat maps of Yamaguchi et al. (submitted,
Figure 2).
The plot is a ggplot object, so it can be changed further by adding
ggplot2 functions, for example ggplot2::labs() for the title
and the axis labels, ggplot2::theme() for the text and the legend,
and ggplot2::scale_colour_manual() or
ggplot2::scale_linetype_manual() for the curves of one endpoint.
The colors of the heat maps are set by the color arguments.
A ggplot object.
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) oc <- qdm_oc(des, data.frame(pi_t = seq(0.2, 0.9, by = 0.05), pi_c = 0.4)) plot(oc) # Other colors, thinner lines, larger text and the legend on the right, # with a title added by ggplot2 plot(oc, col_go = "darkgreen", col_nogo = "firebrick", linewidth = 0.6, base_size = 14, legend_position = "right") + ggplot2::labs(title = "Operating characteristics") # Two binary endpoints: one heat map per decision, or a single heat map # of the decision with the highest probability in each cell prior <- prior_dirichlet(rep(0.25, 4)) des2 <- design_binary2( n_t = 6, n_c = 6, prior_t = prior, prior_c = prior, criterion = criterion_posterior(theta_tv = c(0.15, 0.15), theta_mav = c(0.1, 0.1), gamma_go = 0.6, gamma_nogo = 0.6), nMC = 500 ) eff <- expand.grid(theta1 = c(0, 0.2, 0.4), theta2 = c(0, 0.2, 0.4)) oc2 <- qdm_oc(des2, data.frame(pi_t1 = 0.2 + eff$theta1, pi_t2 = 0.2 + eff$theta2, rho_t = 0.3, pi_c1 = 0.2, pi_c2 = 0.2, rho_c = 0.3), seed = 1) plot(oc2) plot(oc2, overlay = TRUE) plot(oc2, overlay = TRUE, cell_values = FALSE)des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) oc <- qdm_oc(des, data.frame(pi_t = seq(0.2, 0.9, by = 0.05), pi_c = 0.4)) plot(oc) # Other colors, thinner lines, larger text and the legend on the right, # with a title added by ggplot2 plot(oc, col_go = "darkgreen", col_nogo = "firebrick", linewidth = 0.6, base_size = 14, legend_position = "right") + ggplot2::labs(title = "Operating characteristics") # Two binary endpoints: one heat map per decision, or a single heat map # of the decision with the highest probability in each cell prior <- prior_dirichlet(rep(0.25, 4)) des2 <- design_binary2( n_t = 6, n_c = 6, prior_t = prior, prior_c = prior, criterion = criterion_posterior(theta_tv = c(0.15, 0.15), theta_mav = c(0.1, 0.1), gamma_go = 0.6, gamma_nogo = 0.6), nMC = 500 ) eff <- expand.grid(theta1 = c(0, 0.2, 0.4), theta2 = c(0, 0.2, 0.4)) oc2 <- qdm_oc(des2, data.frame(pi_t1 = 0.2 + eff$theta1, pi_t2 = 0.2 + eff$theta2, rho_t = 0.3, pi_c1 = 0.2, pi_c2 = 0.2, rho_c = 0.3), seed = 1) plot(oc2) plot(oc2, overlay = TRUE) plot(oc2, overlay = TRUE, cell_values = FALSE)
Print an external data specification
## S3 method for class 'qdm_borrow' print(x, ...)## S3 method for class 'qdm_borrow' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
print(borrow(data_binary(n = 20, y = 8), a0 = 0.5))print(borrow(data_binary(n = 20, y = 8), a0 = 0.5))
Prints the decision intervals of qdm_boundary as up to
three tables, each with one row per condition (for example, the number of
control responders or the treatment group size) and one column per
decision. The first table gives the range of the observed quantity
(numbers of responders or events, or observed means), the second the
corresponding observed response rates or milestone survival
probabilities, and the last the observed treatment effects. For example,
the entry "10-20" in the column Go means that 10 to 20
responders lead to a Go decision. The object itself
is a data frame with one row per interval (see qdm_boundary).
## S3 method for class 'qdm_boundary' print(x, digits = 4L, n = 20L, ...)## S3 method for class 'qdm_boundary' print(x, digits = 4L, n = 20L, ...)
x |
An object of class |
digits |
Number of significant digits for observed means, milestone survival probabilities, effects and conditions. |
n |
Maximum number of conditions shown in each table. |
... |
Not used. |
x, invisibly.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) b <- qdm_boundary(des) print(b, n = 5) # The intervals as a data frame head(as.data.frame(b))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) b <- qdm_boundary(des) print(b, n = 5) # The intervals as a data frame head(as.data.frame(b))
Prints the chosen thresholds and the decision probabilities of the design with these thresholds under the two scenarios.
## S3 method for class 'qdm_calibration' print(x, digits = 4L, ...)## S3 method for class 'qdm_calibration' print(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for numeric values. |
... |
Not used. |
x, invisibly.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) print(qdm_calibrate(des, data.frame(pi_t = 0.4, pi_c = 0.4), data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) print(qdm_calibrate(des, data.frame(pi_t = 0.4, pi_c = 0.4), data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2))
Print the conduct of a study
## S3 method for class 'qdm_conduct' print(x, ...)## S3 method for class 'qdm_conduct' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
conduct_tte(accrual_time = c(0, 12), cut_events = 20)conduct_tte(accrual_time = c(0, 12), cut_events = 20)
Print a decision criterion
## S3 method for class 'qdm_criterion' print(x, ...)## S3 method for class 'qdm_criterion' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
print(criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7))print(criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7))
Print a data specification
## S3 method for class 'qdm_data' print(x, ...)## S3 method for class 'qdm_data' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
print(data_continuous(n = 12, mean = 3.2, sd = 2))print(data_continuous(n = 12, mean = 3.2, sd = 2))
Print a decision
## S3 method for class 'qdm_decision' print(x, ...)## S3 method for class 'qdm_decision' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7) ) print(qdm_decide(des, data_binary(12, 9), data_binary(12, 4)))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_predictive(theta_null = 0, m_t = 50, gamma_go = 0.9, gamma_nogo = 0.7) ) print(qdm_decide(des, data_binary(12, 9), data_binary(12, 4)))
Print a design
## S3 method for class 'qdm_design' print(x, ...)## S3 method for class 'qdm_design' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
des <- design_binary( n_t = 12, n_c = 0, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8), hypothetical_c = hypothetical(data = data_binary(n = 12, y = 4)) ) print(des)des <- design_binary( n_t = 12, n_c = 0, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8), hypothetical_c = hypothetical(data = data_binary(n = 12, y = 4)) ) print(des)
Print a hypothetical control specification
## S3 method for class 'qdm_hypothetical' print(x, ...)## S3 method for class 'qdm_hypothetical' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
print(hypothetical(data = data_binary(n = 15, y = 5)))print(hypothetical(data = data_binary(n = 15, y = 5)))
Print operating characteristics
## S3 method for class 'qdm_oc' print(x, digits = 4L, ...)## S3 method for class 'qdm_oc' print(x, digits = 4L, ...)
x |
An object of class |
digits |
Number of significant digits for the probabilities. |
... |
Not used. |
x, invisibly.
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) print(qdm_oc(des, data.frame(pi_t = c(0.4, 0.6), pi_c = 0.4)))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) print(qdm_oc(des, data.frame(pi_t = c(0.4, 0.6), pi_c = 0.4)))
Print a prior specification
## S3 method for class 'qdm_prior' print(x, ...)## S3 method for class 'qdm_prior' print(x, ...)
x |
An object of class |
... |
Passed to |
x, invisibly.
print(prior_nix(mu0 = 0, kappa0 = 1, nu0 = 3, sigma0 = 2))print(prior_nix(mu0 = 0, kappa0 = 1, nu0 = 3, sigma0 = 2))
Creates a Beta prior distribution for the response rate of one group in an analysis of a single binary endpoint.
prior_beta(a, b)prior_beta(a, b)
a, b
|
Positive shape parameters. |
An object of class c("qdm_prior_beta", "qdm_prior") with
elements a and b.
Other priors:
prior_dirichlet(),
prior_gamma(),
prior_niw(),
prior_nix(),
prior_vague()
prior_beta(0.5, 0.5)prior_beta(0.5, 0.5)
Creates a Dirichlet prior distribution for the four joint response probabilities of two binary endpoints in one group.
prior_dirichlet(alpha)prior_dirichlet(alpha)
alpha |
A numeric vector of four positive concentration parameters in
the cell order |
The four cells are ordered as "00", "01", "10" and
"11", where the first digit is the response on endpoint 1 and the
second digit is the response on endpoint 2 (1 = response, 0 = no
response). The marginal response rates are therefore
and .
With alpha = rep(0.25, 4), each marginal response rate has a
Beta(0.5, 0.5) prior distribution.
An object of class c("qdm_prior_dirichlet", "qdm_prior")
with element alpha, a named numeric vector of length 4.
Other priors:
prior_beta(),
prior_gamma(),
prior_niw(),
prior_nix(),
prior_vague()
prior_dirichlet(rep(0.25, 4))prior_dirichlet(rep(0.25, 4))
Creates a Gamma prior distribution for the hazard rate of
one group in an analysis of a time-to-event endpoint with exponential
event times. The milestone survival probability at time is
.
prior_gamma(shape, rate)prior_gamma(shape, rate)
shape, rate
|
Positive shape and rate parameters (the prior mean of
the hazard is |
The prior is equivalent to shape events observed during a total
observed time of rate, so small values give a weakly informative
prior: prior_gamma(0.1, 1) carries the information of a tenth of an
event.
An object of class c("qdm_prior_gamma", "qdm_prior") with
elements shape and rate.
Other priors:
prior_beta(),
prior_dirichlet(),
prior_niw(),
prior_nix(),
prior_vague()
prior_gamma(0.1, 1)prior_gamma(0.1, 1)
Creates the conjugate Normal-Inverse-Wishart prior for the mean vector
and covariance matrix of a bivariate normal endpoint
in one group:
prior_niw(mu0, kappa0, nu0, Lambda0)prior_niw(mu0, kappa0, nu0, Lambda0)
mu0 |
Numeric vector of length 2, the prior mean of |
kappa0 |
Positive prior sample size for |
nu0 |
Prior degrees of freedom of the inverse Wishart distribution; must be greater than 1. |
Lambda0 |
A 2 x 2 symmetric positive definite scale matrix. |
An object of class c("qdm_prior_niw", "qdm_prior") with
elements mu0, kappa0, nu0 and Lambda0.
Other priors:
prior_beta(),
prior_dirichlet(),
prior_gamma(),
prior_nix(),
prior_vague()
prior_niw(mu0 = c(0, 0), kappa0 = 1, nu0 = 4, Lambda0 = diag(2))prior_niw(mu0 = c(0, 0), kappa0 = 1, nu0 = 4, Lambda0 = diag(2))
Creates the conjugate Normal-Inverse-chi-squared prior for the mean
and variance of a normally distributed endpoint in
one group:
prior_nix(mu0, kappa0, nu0, sigma0)prior_nix(mu0, kappa0, nu0, sigma0)
mu0 |
Prior mean of |
kappa0 |
Positive prior sample size for |
nu0 |
Positive prior degrees of freedom for |
sigma0 |
Positive prior scale of |
An object of class c("qdm_prior_nix", "qdm_prior") with
elements mu0, kappa0, nu0 and sigma0.
Other priors:
prior_beta(),
prior_dirichlet(),
prior_gamma(),
prior_niw(),
prior_vague()
prior_nix(mu0 = 0, kappa0 = 1, nu0 = 3, sigma0 = 2)prior_nix(mu0 = 0, kappa0 = 1, nu0 = 3, sigma0 = 2)
Creates the vague (reference) prior for the parameters of a normally
distributed endpoint. For one endpoint the prior density is
; for two endpoints it is
. With observations the
posterior distribution of the mean is a t distribution with
degrees of freedom for one endpoint and a bivariate t distribution with
degrees of freedom for two endpoints.
prior_vague()prior_vague()
An object of class c("qdm_prior_vague", "qdm_prior").
Other priors:
prior_beta(),
prior_dirichlet(),
prior_gamma(),
prior_niw(),
prior_nix()
prior_vague()prior_vague()
Computes (or the upper tail
) for the milestone survival probabilities
, where the hazards have independent
Gamma distributions, and
(shape and rate). This is
the posterior probability used for a time-to-event endpoint with a
concurrent, external or hypothetical control.
psurvdiff(q, milestone, shape_t, rate_t, shape_c, rate_c, lower.tail = TRUE)psurvdiff(q, milestone, shape_t, rate_t, shape_c, rate_c, lower.tail = TRUE)
q |
Numeric vector of quantiles. |
milestone |
Positive milestone time |
shape_t, rate_t
|
Positive shape and rate of the treatment hazard. |
shape_c, rate_c
|
Positive shape and rate of the control hazard. |
lower.tail |
Logical; if |
The upper tail is computed as
where is the density of , is the
distribution function of , the integral runs over the
values of with , and the
first term is zero for . The integral is evaluated by
adaptive Gauss-Kronrod quadrature (the QUADPACK routine used by
integrate), with the range split at quantiles of the
control hazard and at the values that correspond to quantiles of the
treatment hazard. When the density of is unbounded at 0
(), the integral below its median is evaluated in the
variable , in which the integrand is bounded. The
lower tail is computed from the same formula with the roles of the two
groups exchanged, so both tails are accurate near 0.
A numeric vector of probabilities. All arguments except
lower.tail are recycled to a common length; each must have length
1 or the common length.
Other distributions:
cellprob_binary2(),
pbetabinomdiff(),
pbetadiff(),
phazardratio(),
ptdiff(),
rdirichlet()
# Posterior probability that the 3-month survival is higher by more than # 0.1 with 5 events in 40 months of follow-up versus 9 events in 35 months # (Gamma(0.1, 1) priors) psurvdiff(0.1, milestone = 3, shape_t = 5.1, rate_t = 41, shape_c = 9.1, rate_c = 36, lower.tail = FALSE)# Posterior probability that the 3-month survival is higher by more than # 0.1 with 5 events in 40 months of follow-up versus 9 events in 35 months # (Gamma(0.1, 1) priors) psurvdiff(0.1, milestone = 3, shape_t = 5.1, rate_t = 41, shape_c = 9.1, rate_c = 36, lower.tail = FALSE)
Computes (or the upper tail
) for independent location-scale t variables
, where follows a t distribution with
degrees of freedom. This is the posterior (or posterior
predictive) probability used for a single continuous endpoint.
ptdiff( q, mu_t, scale_t, df_t, mu_c, scale_c, df_c, method = c("NI", "MM", "MC"), nMC = 10000L, lower.tail = TRUE )ptdiff( q, mu_t, scale_t, df_t, mu_c, scale_c, df_c, method = c("NI", "MM", "MC"), nMC = 10000L, lower.tail = TRUE )
q |
Numeric vector of quantiles. |
mu_t, scale_t, df_t
|
Location, positive scale and positive degrees of freedom of the treatment group. |
mu_c, scale_c, df_c
|
Location, positive scale and positive degrees of freedom of the control group. |
method |
One of |
nMC |
Number of Monte Carlo draws per element for |
lower.tail |
Logical; if |
Three methods are available.
"NI"Numerical integration over the whole real line by
adaptive Gauss-Kronrod quadrature (the QUADPACK routine used by
integrate). The integral is taken over the
variable of the group with the smaller scale, for example
when
. The range is split around the peak of the density
and around the change of the other factor, and the parts far from the
origin are integrated on a logarithmic scale, so that heavy tails and
very different scales are handled. The absolute error is below
in the tests, which include scale ratios from
to and degrees of freedom from 0.5 to
Inf.
"MM"The moment-matching approximation of Yamaguchi,
Homma, Takeda and Maruo (submitted, Theorem 1), which replaces the
difference by a single t
distribution with matched second and fourth moments. It requires
and , is evaluated in closed form, and is
the fastest method.
"MC"Monte Carlo simulation with nMC draws for each
element, using the random number generator of R.
Degrees of freedom may be Inf (normal distributions). For the lower
tail, the upper tail of at is computed, so both
tails are accurate near 0.
A numeric vector of probabilities. All arguments from q to
df_c are recycled to a common length; each must have length 1 or
the common length.
Yamaguchi, Y., Homma, G., Takeda, K. and Maruo, K. (submitted). Moment-matching approximation for t-differences in clinical trials with continuous endpoints.
Other distributions:
cellprob_binary2(),
pbetabinomdiff(),
pbetadiff(),
phazardratio(),
psurvdiff(),
rdirichlet()
ptdiff(1, mu_t = 3, scale_t = 1, df_t = 15, mu_c = 1, scale_c = 1, df_c = 15, lower.tail = FALSE) ptdiff(1, mu_t = 3, scale_t = 1, df_t = 15, mu_c = 1, scale_c = 1, df_c = 15, method = "MM", lower.tail = FALSE)ptdiff(1, mu_t = 3, scale_t = 1, df_t = 15, mu_c = 1, scale_c = 1, df_c = 15, lower.tail = FALSE) ptdiff(1, mu_t = 3, scale_t = 1, df_t = 15, mu_c = 1, scale_c = 1, df_c = 15, method = "MM", lower.tail = FALSE)
Finds the observed data that lead to each decision (Go, NoGo, Gray, or
Miss) of a design: for example, how many responders out of are
needed for a Go decision, or how large the observed difference in means
must be. Unlike the operating characteristics, the result does not depend
on the true parameters. It is a table of decision intervals of an
observed quantity (the numbers of responders or events, or an observed
mean), one set of intervals for each value of a second quantity (the
condition), together with the corresponding observed response rates,
milestone survival probabilities and treatment effects. The intervals are
printed as tables (print.qdm_boundary) and drawn as the
regions of the decisions with the boundary values written on them
(plot.qdm_boundary).
qdm_boundary( design, n_t = NULL, mean_t = NULL, sd_t = NULL, cov_t = NULL, events_t = NULL, exposure_t = NULL, data_c = NULL, seed = NULL )qdm_boundary( design, n_t = NULL, mean_t = NULL, sd_t = NULL, cov_t = NULL, events_t = NULL, exposure_t = NULL, data_c = NULL, seed = NULL )
design |
A design created by |
n_t |
Numbers of subjects in the treatment group (whole numbers); by
default that of the design. Several values are allowed for one binary
endpoint without a concurrent control group and for one continuous
endpoint. For a time-to-event endpoint, |
mean_t |
For one continuous endpoint, an optional numeric vector: the grid of observed treatment means on which the boundary values are searched. For two continuous endpoints, a list of two numeric vectors: the observed treatment means of endpoint 1 (the conditions) and the grid of observed treatment means of endpoint 2. |
sd_t |
Observed treatment standard deviations (one continuous endpoint; positive). |
cov_t |
Observed treatment covariance matrix (two continuous endpoints; a 2 x 2 positive definite matrix). |
events_t |
Numbers of events of the treatment group (time-to-event
endpoint; whole numbers); by default |
exposure_t |
Total observed times of the treatment group (time-to-event endpoint; positive). |
data_c |
Observed data of the concurrent control group, created by
|
seed |
Random seed for probabilities computed by Monte Carlo
simulation, or |
The observed quantity and the conditions depend on the endpoint:
The number of responders of the treatment
group . With a concurrent control group, one
set of intervals for each number of control responders
(n_t must be a single number;
is that of the design). Without one, one set for each
sample size in n_t, which shows how the boundary changes with
the sample size.
The observed treatment mean, for each
combination of sd_t and n_t (at most one of them may
have more than one value). With a concurrent control group,
data_c gives the observed control data. The boundary values
are located by bisection between the values of a grid, mean_t
or by default a grid of 201 values that covers the thresholds of the
criterion.
The observed treatment mean of endpoint
2, located by bisection on the grid mean_t[[2]], for each
observed treatment mean of endpoint 1 in mean_t[[1]], with the
sample covariance matrix cov_t and n_t subjects (a
single number). With a concurrent control group, data_c gives
the observed control data.
The number of events of the treatment
group (events_t), for each total observed time in
exposure_t. With a concurrent control group, data_c
gives the observed control data.
Two binary endpoints are not supported, because their decision depends on the four cell counts and cannot be summarized by one observed quantity.
The decision for each value is made as in qdm_decide. For an
observed mean, the first and last intervals extend to minus and plus
infinity; changes of the decision beyond the grid (whose ends are
extended by two values far beyond them) or two changes of the same
criterion between two neighboring grid values are not detected. With a
conjugate (Normal-Inverse-chi-squared) prior, the posterior scale
increases with the distance between the observed mean and the prior
mean, so the probability of the Go region need not increase with the
observed mean; the intervals then show where it decreases again.
Probabilities computed by Monte Carlo simulation (method = "MC",
or posterior predictive probabilities of a time-to-event endpoint) make
the boundary values approximate.
An object of class c("qdm_boundary", "data.frame") with one
row per decision interval and the columns
n_t, n_c and y_c (binary;
only n_t without a concurrent control group),
n_t and sd_t (continuous), n_t,
mean_t1 and effect1 (two continuous endpoints; the
observed treatment mean of endpoint 1 and its difference from the
control) or exposure_t (time-to-event).
The decision (a factor with levels "Go",
"NoGo", "Gray" and "Miss").
The ends of the interval of the observed quantity: the number of treatment responders or events (both ends included), or the observed treatment mean (of endpoint 2).
Binary endpoint: the observed response
rates at the ends.
Time-to-event endpoint evaluated by the
milestone survival: the observed milestone survival probabilities
at the ends.
The observed treatment effect at the
ends: the observed rate, mean or milestone survival minus that of
the concurrent control group, or minus the fixed control value or
the mean (location) of the distribution of the control group; for
the hazard ratio, the observed hazard divided by the
observed control hazard (NA if the control group has no
events), the fixed control hazard or the mean of the distribution
of the control hazard. The values correspond to
from and to, so effect_from is larger than
effect_to when larger values of the observed quantity give
smaller effects (for example, more events and the milestone
survival).
The attributes design, axes, titles,
increasing, discrete and range record the design
and the information used by the print and plot methods.
Other operations:
qdm_calibrate(),
qdm_decide(),
qdm_oc()
# Single-arm study with a fixed control response rate of 0.2: responders # needed out of 10 to 30 subjects des <- design_binary( n_t = 20, n_c = 0, prior_t = prior_beta(1, 1), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.05, gamma_go = 0.8, gamma_nogo = 0.8), fixed_c = 0.2 ) b <- qdm_boundary(des, n_t = c(10, 20, 30)) b plot(b) # Continuous endpoint with a concurrent control group: observed # differences in means needed for each observed standard deviation des2 <- design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), method = "MM" ) b2 <- qdm_boundary(des2, sd_t = c(20, 25, 30), data_c = data_continuous(12, 0, 25)) b2 plot(b2)# Single-arm study with a fixed control response rate of 0.2: responders # needed out of 10 to 30 subjects des <- design_binary( n_t = 20, n_c = 0, prior_t = prior_beta(1, 1), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.05, gamma_go = 0.8, gamma_nogo = 0.8), fixed_c = 0.2 ) b <- qdm_boundary(des, n_t = c(10, 20, 30)) b plot(b) # Continuous endpoint with a concurrent control group: observed # differences in means needed for each observed standard deviation des2 <- design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), method = "MM" ) b2 <- qdm_boundary(des2, sd_t = c(20, 25, 30), data_c = data_continuous(12, 0, 25)) b2 plot(b2)
Chooses the thresholds and of the
criterion of a design so that the probabilities of a false Go decision and
a false NoGo decision are controlled.
qdm_calibrate( design, scenario_go, scenario_nogo, target_go, target_nogo, grid = seq(0.01, 0.99, by = 0.01), nsim = 10000L, seed = NULL )qdm_calibrate( design, scenario_go, scenario_nogo, target_go, target_nogo, grid = seq(0.01, 0.99, by = 0.01), nsim = 10000L, seed = NULL )
design |
A design created by |
scenario_go, scenario_nogo
|
Data frames with one row each, giving the
scenarios used to calibrate |
target_go, target_nogo
|
Upper bounds for the probabilities that the
Go criterion is met under |
grid |
Candidate thresholds, strictly between 0 and 1. |
nsim, seed
|
As in |
The threshold is the smallest value in grid for
which the probability that the Go criterion is met under
scenario_go (typically a scenario with no or a small treatment
effect) is at most target_go. The threshold is
the smallest value in grid for which the probability that the NoGo
criterion is met under scenario_nogo (typically a scenario with the
expected treatment effect) is at most target_nogo. Both
probabilities decrease as the threshold increases, so the chosen thresholds
are the least strict ones that meet the targets.
The decision probabilities of the design with the chosen thresholds are
computed under both scenarios. If
(and, for two endpoints with the marginal rule "or", for any
thresholds), Miss decisions (both criteria met) can occur, and a warning is
given when they have positive probability.
An object of class "qdm_calibration": a list with elements
The chosen thresholds (NA if no
value in grid meets the target).
The probabilities that the Go criterion is
met under scenario_go and that the NoGo criterion is met under
scenario_nogo, at the chosen thresholds.
The targets.
A data frame with the columns gamma (the grid),
prob_go and prob_nogo (the two probabilities at each
threshold).
A data frame of the decision probabilities with the chosen
thresholds under the two scenarios (NULL if a threshold was
not found).
The design with the chosen thresholds (NULL if a
threshold was not found).
The scenarios and the method of computation.
Other operations:
qdm_boundary(),
qdm_decide(),
qdm_oc()
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) cal <- qdm_calibrate(des, scenario_go = data.frame(pi_t = 0.4, pi_c = 0.4), scenario_nogo = data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2) cal plot(cal) cal$designdes <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) cal <- qdm_calibrate(des, scenario_go = data.frame(pi_t = 0.4, pi_c = 0.4), scenario_nogo = data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.05, target_nogo = 0.2) cal plot(cal) cal$design
Computes the probabilities of the Go and NoGo regions given the observed proof-of-concept data, and makes the decision of a design.
qdm_decide(design, data_t, data_c = NULL, seed = NULL)qdm_decide(design, data_t, data_c = NULL, seed = NULL)
design |
A design created by |
data_t |
Observed data of the treatment group, created by
|
data_c |
Observed data of the concurrent control group, created by
the same function as |
seed |
Random seed for probabilities computed by Monte Carlo
simulation (a continuous design with |
The decision is Go if only the Go criterion is met, NoGo if only the NoGo
criterion is met, Gray if neither is met, and Miss if both are met (see
criterion_posterior and criterion_predictive).
A probability that is below a threshold by less than is
treated as equal to the threshold, so that ties that arise in symmetric
settings are not decided by rounding errors.
The sample sizes of the observed data may differ from those of the design,
which are used only by qdm_oc and qdm_calibrate.
An object of class "qdm_decision": a list with elements
"Go", "NoGo", "Gray" or
"Miss".
Probabilities of the Go and NoGo regions (for two endpoints with a marginal rule, one probability per endpoint).
For two endpoints, the probabilities of all
regions (see qdm_regions); NULL otherwise.
Whether the Go and NoGo criteria are met.
Parameters of the posterior
distributions of the treatment and control groups: for a binary
endpoint, the Beta parameters a and b; for a
continuous endpoint, the Normal-Inverse-chi-squared parameters
mu, kappa, nu and sigma (on the standard
deviation scale), so that the mean has the distribution
. For a hypothetical control,
posterior_c gives the distribution of the control mean in the
same form (see design_continuous). For two binary
endpoints, the Dirichlet parameters of the cells "00",
"01", "10" and "11". For two continuous
endpoints, the Normal-Inverse-Wishart parameters mu1,
mu2, kappa, nu and the elements L11,
L12 and L22 of , so that the mean has the
distribution .
For a time-to-event endpoint, the shape and rate of the Gamma
distribution of the hazard. For a fixed control, posterior_c
is the fixed value (named value, or value1 and
value2 for two endpoints).
The arguments.
Other operations:
qdm_boundary(),
qdm_calibrate(),
qdm_oc()
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) qdm_decide(des, data_t = data_binary(12, 9), data_c = data_binary(12, 4)) # Continuous endpoint des2 <- design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7) ) qdm_decide(des2, data_t = data_continuous(12, 18, 25), data_c = data_continuous(12, -12, 25))des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) qdm_decide(des, data_t = data_binary(12, 9), data_c = data_binary(12, 4)) # Continuous endpoint des2 <- design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7) ) qdm_decide(des2, data_t = data_continuous(12, 18, 25), data_c = data_continuous(12, -12, 25))
Computes the probabilities of Go, NoGo, Gray and Miss decisions of a design under scenarios for the true parameters.
qdm_oc(design, scenarios, nsim = 10000L, seed = NULL)qdm_oc(design, scenarios, nsim = 10000L, seed = NULL)
design |
A design created by |
scenarios |
A data frame with one row per scenario. For a binary
endpoint the columns |
nsim |
Number of simulated studies per scenario for designs whose operating characteristics are computed by simulation. |
seed |
Random seed for the simulation and for Monte Carlo estimates
of probabilities, or |
For a binary endpoint, all possible outcomes of the proof-of-concept study
are enumerated and the probabilities are exact (Kang et al., 2026, Section
4.3); nsim and seed are not used.
For a continuous endpoint, nsim studies are simulated under each
scenario. Only the sufficient statistics are simulated: the sample mean
and the sample standard deviation
, with and
. The same random numbers are used for all
scenarios, so the results change smoothly across scenarios. The
probabilities have a simulation standard error of at most
(0.005 for the default nsim). For each
simulated study, the probabilities of the Go and NoGo regions are computed
by the method of the design (see design_continuous), of which
method = "MM" is the fastest. To explore many scenarios or designs,
method = "MM" or a smaller nsim gives results quickly; the
chosen design can then be checked with method = "NI" and the
default nsim.
For two binary endpoints, all outcomes are enumerated (Yamaguchi et al.,
submitted, equation A.5) or nsim studies are simulated, as specified
by enumerate in design_binary2. The response rates
and correlation of each group are converted to cell probabilities by
cellprob_binary2; a scenario whose correlation is outside the
feasible range for its response rates is not evaluable, and its
probabilities are NA (with a warning).
For two continuous endpoints, nsim studies are simulated under each
scenario. Only the sufficient statistics are simulated: the sample means
and the matrix of sums of squares and
cross-products , where is the Cholesky
factor of the covariance matrix of the scenario, has two
independent standard normal elements and is the Bartlett factor
of a Wishart distribution with degrees of freedom. The same
random numbers are used for all scenarios.
For a time-to-event endpoint, nsim studies are simulated under each
scenario as specified by the conduct of the design (enrollment, dropout
and analysis time; see conduct_tte), with exponential event
times whose hazard is for the median survival time
of the scenario. The same random numbers are used for all
scenarios. With a predictive criterion, every simulated study needs
nMC simulated future studies (see design_tte), so
the computing time grows with nsim times nMC.
The decision for each outcome is made as in qdm_decide. A
warning is given when Miss decisions (both criteria met) have positive
probability in some scenario.
An object of class c("qdm_oc", "data.frame"): the scenarios
with the columns Go, NoGo, Gray and Miss
added. The attributes design and method record the design
and the method of computation.
Kang, R., Yamaguchi, Y. and Han, C. (2026). Bayesian quantitative decision-making framework in cell and gene therapy development for rare diseases. Journal of Biopharmaceutical Statistics. doi:10.1080/10543406.2026.2655410
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
Other operations:
qdm_boundary(),
qdm_calibrate(),
qdm_decide()
des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) oc <- qdm_oc(des, data.frame(pi_t = seq(0.2, 0.8, by = 0.1), pi_c = 0.4)) oc plot(oc) # Continuous endpoint (moment-matching approximation for speed) des2 <- design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), method = "MM" ) oc2 <- qdm_oc(des2, data.frame(mu_t = seq(0, 50, by = 10), sd_t = 25, mu_c = 0, sd_c = 25), nsim = 2000, seed = 1) oc2 # Two binary endpoints (small nMC for speed) des3 <- design_binary2( n_t = 6, n_c = 6, prior_t = prior_dirichlet(rep(0.25, 4)), prior_c = prior_dirichlet(rep(0.25, 4)), criterion = criterion_posterior(theta_tv = c(0.15, 0.15), theta_mav = c(0.10, 0.10), gamma_go = 0.3, gamma_nogo = 0.4), nMC = 2000 ) effects <- expand.grid(theta1 = c(0, 0.15, 0.3), theta2 = c(0, 0.15, 0.3)) oc3 <- qdm_oc(des3, data.frame(pi_t1 = 0.2 + effects$theta1, pi_t2 = 0.2 + effects$theta2, rho_t = 0.3, pi_c1 = 0.2, pi_c2 = 0.2, rho_c = 0.3), seed = 1) oc3 plot(oc3)des <- design_binary( n_t = 12, n_c = 12, prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5), criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1, gamma_go = 0.5, gamma_nogo = 0.8) ) oc <- qdm_oc(des, data.frame(pi_t = seq(0.2, 0.8, by = 0.1), pi_c = 0.4)) oc plot(oc) # Continuous endpoint (moment-matching approximation for speed) des2 <- design_continuous( n_t = 12, n_c = 12, prior_t = prior_vague(), prior_c = prior_vague(), criterion = criterion_posterior(theta_tv = 30, theta_mav = 15, gamma_go = 0.6, gamma_nogo = 0.7), method = "MM" ) oc2 <- qdm_oc(des2, data.frame(mu_t = seq(0, 50, by = 10), sd_t = 25, mu_c = 0, sd_c = 25), nsim = 2000, seed = 1) oc2 # Two binary endpoints (small nMC for speed) des3 <- design_binary2( n_t = 6, n_c = 6, prior_t = prior_dirichlet(rep(0.25, 4)), prior_c = prior_dirichlet(rep(0.25, 4)), criterion = criterion_posterior(theta_tv = c(0.15, 0.15), theta_mav = c(0.10, 0.10), gamma_go = 0.3, gamma_nogo = 0.4), nMC = 2000 ) effects <- expand.grid(theta1 = c(0, 0.15, 0.3), theta2 = c(0, 0.15, 0.3)) oc3 <- qdm_oc(des3, data.frame(pi_t1 = 0.2 + effects$theta1, pi_t2 = 0.2 + effects$theta2, rho_t = 0.3, pi_c1 = 0.2, pi_c2 = 0.2, rho_c = 0.3), seed = 1) oc3 plot(oc3)
Shows how the regions used by the decision criteria for two endpoints are numbered (Yamaguchi et al., submitted, Tables 1 and 2).
qdm_regions(prob = c("posterior", "predictive"), direction = "greater")qdm_regions(prob = c("posterior", "predictive"), direction = "greater")
prob |
Either |
direction |
|
For posterior probability, the target value (TV) and the minimum acceptable
value (MAV) of each endpoint divide the plane of
into nine regions. Columns correspond to endpoint 1 and rows to endpoint 2.
For posterior predictive probability, the null values divide the plane into
four regions.
For an endpoint on which smaller effects are favorable
(direction = "less" in the criterion), the inequalities of that
endpoint are reversed, so that region 1 is always the most favorable one:
for example, "theta2 < TV2", "TV2 <= theta2 < MAV2" and
"theta2 >= MAV2".
A character matrix of region labels (printed without quotes), with the conditions on endpoint 1 as column names and those on endpoint 2 as row names.
Yamaguchi, Y., Hu, H., Huang, Y., Han, C., Homma, G. and Wang, A. (submitted). Bivariate Bayesian quantitative decision-making for two endpoints in rare disease drug development.
qdm_regions("posterior") qdm_regions("predictive") # Endpoint 2 is a safety endpoint (smaller effects are favorable) qdm_regions("posterior", direction = c("greater", "less"))qdm_regions("posterior") qdm_regions("predictive") # Endpoint 2 is a safety endpoint (smaller effects are favorable) qdm_regions("posterior", direction = c("greater", "less"))
Draws random vectors from the Dirichlet distribution by normalizing independent Gamma variables, using the random number generator of R.
rdirichlet(n, alpha)rdirichlet(n, alpha)
n |
Number of draws (a whole number of at least 1). |
alpha |
Numeric vector of at least two positive concentration parameters. |
A numeric matrix with n rows and length(alpha)
columns whose rows sum to 1 (a matrix is returned even when
n = 1). Column names are taken from names(alpha).
Other distributions:
cellprob_binary2(),
pbetabinomdiff(),
pbetadiff(),
phazardratio(),
psurvdiff(),
ptdiff()
set.seed(1) rdirichlet(3, c(1.5, 0.5, 2, 1))set.seed(1) rdirichlet(3, c(1.5, 0.5, 2, 1))