Chooses the thresholds \(\gamma_{go}\) and \(\gamma_{nogo}\) of the criterion of a design so that the probabilities of a false Go decision and a false NoGo decision are controlled.
Usage
qdm_calibrate(
design,
scenario_go,
scenario_nogo,
target_go,
target_nogo,
grid = seq(0.01, 0.99, by = 0.01),
nsim = 10000L,
seed = NULL
)Arguments
- design
A design created by
design_binary,design_continuous,design_binary2,design_continuous2ordesign_tte. Its thresholds are replaced by the calibrated ones. For two endpoints with a marginal rule (rule = "and"or"or"), the same threshold is used for both endpoints.- scenario_go, scenario_nogo
Data frames with one row each, giving the scenarios used to calibrate \(\gamma_{go}\) and \(\gamma_{nogo}\) (see
qdm_ocfor the columns). For two binary endpoints, the correlations must be feasible.- target_go, target_nogo
Upper bounds for the probabilities that the Go criterion is met under
scenario_goand that the NoGo criterion is met underscenario_nogo, strictly between 0 and 1.- grid
Candidate thresholds, strictly between 0 and 1.
- nsim, seed
As in
qdm_oc. The probabilities for all values ofgridare computed from the same outcomes (simulated studies or enumerated outcomes) and the same Monte Carlo draws.
Value
An object of class "qdm_calibration": a list with elements
- gamma_go, gamma_nogo
The chosen thresholds (
NAif no value ingridmeets the target).- prob_go, prob_nogo
The probabilities that the Go criterion is met under
scenario_goand that the NoGo criterion is met underscenario_nogo, at the chosen thresholds.- target_go, target_nogo
The targets.
- curve
A data frame with the columns
gamma(the grid),prob_goandprob_nogo(the two probabilities at each threshold).- oc
A data frame of the decision probabilities with the chosen thresholds under the two scenarios (
NULLif a threshold was not found).- design
The design with the chosen thresholds (
NULLif a threshold was not found).- scenario_go, scenario_nogo, method
The scenarios and the method of computation.
Details
The threshold \(\gamma_{go}\) 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 \(\gamma_{nogo}\) 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 \(\gamma_{go} + \gamma_{nogo} \le 1\)
(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.
See also
Other operations:
qdm_boundary(),
qdm_decide(),
qdm_oc()
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)
)
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
#> Calibration of the decision thresholds (exact enumeration of the outcomes)
#> gamma_go = 0.74: P(Go criterion met | scenario_go) = 0.03368 (target 0.05)
#> gamma_nogo = 0.39: P(NoGo criterion met | scenario_nogo) = 0.182 (target 0.2)
#> Decision probabilities with the chosen thresholds
#> scenario pi_t pi_c Go NoGo Gray Miss
#> scenario_go 0.4 0.4 0.03368 0.7338 0.2326 0
#> scenario_nogo 0.7 0.4 0.36483 0.1820 0.4531 0
plot(cal)
cal$design
#> Design: one binary endpoint
#> Treatment: n = 12, prior Beta(a = 0.5, b = 0.5)
#> Control: concurrent, n = 12, prior Beta(a = 0.5, b = 0.5)
#> Posterior probability criterion
#> Go: P(theta > 0.2 | data) >= 0.74
#> NoGo: P(theta <= 0.1 | data) >= 0.39
