Skip to contents

Computes the probabilities of the Go and NoGo regions given the observed proof-of-concept data, and makes the decision of a design.

Usage

qdm_decide(design, data_t, data_c = NULL, seed = NULL)

Arguments

design

A design created by design_binary, design_continuous, design_binary2, design_continuous2 or design_tte.

data_t

Observed data of the treatment group, created by data_binary, data_continuous, data_binary2, data_continuous2 or data_tte (matching the endpoint of the design).

data_c

Observed data of the concurrent control group, created by the same function as data_t; NULL (the default) for a design without a concurrent control group.

seed

Random seed for probabilities computed by Monte Carlo simulation (a continuous design with method = "MC", posterior probabilities for two binary endpoints, or posterior predictive probabilities for a time-to-event endpoint), or NULL to use the current random number stream. If given, the previous state of the random number generator is restored on exit. Not used otherwise.

Value

An object of class "qdm_decision": a list with elements

decision

"Go", "NoGo", "Gray" or "Miss".

prob_go, prob_nogo

Probabilities of the Go and NoGo regions (for two endpoints with a marginal rule, one probability per endpoint).

prob_regions

For two endpoints, the probabilities of all regions (see qdm_regions); NULL otherwise.

met_go, met_nogo

Whether the Go and NoGo criteria are met.

posterior_t, posterior_c

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 \(t_{\nu}(\mu, \sigma^2 / \kappa)\). 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 \(\Lambda\), so that the mean has the distribution \(t_{\nu - 1}(\mu, \Lambda / (\kappa (\nu - 1)))\). 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).

design, data_t, data_c

The arguments.

Details

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 \(10^{-10}\) 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.

See also

Examples

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))
#> Decision: Go
#>   Go:   P(theta > 0.2 | data) = 0.8517 (threshold 0.5, met)
#>   NoGo: P(theta <= 0.1 | data) = 0.05935 (threshold 0.8, not met)
#> Posterior distributions
#>   Treatment: Beta(a = 9.5, b = 3.5)
#>   Control:   Beta(a = 4.5, b = 8.5)

# 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))
#> Decision: Gray
#>   Go:   P(theta > 30 | data) = 0.5 (threshold 0.6, not met)
#>   NoGo: P(theta <= 15 | data) = 0.08784 (threshold 0.7, not met)
#> Posterior distributions
#>   Treatment: mean ~ t(df = 11, location = 18, scale = 7.217)
#>   Control:   mean ~ t(df = 11, location = -12, scale = 7.217)