Helper function for calibrate_thresholds() function that evaluates a single combination of a pp_threshold and a ppp_threshold for a single dataset
eval_thresh(
data,
pp_threshold,
ppp_threshold,
p0,
N,
direction = "greater",
delta = NULL,
monitoring = "futility",
prior = c(0.5, 0.5),
S = 5000
)Returns a tibble with the total sample size at the end of the trial, the number of responses observed at the end of the trial, the pp_threshold considered, the ppp_threshold considered, the observed predictive probability generated from calc_predictive(), and an indicator for whether the trial was positive or not at the end
the name of the dataset
the posterior probability threshold of interest
the posterior probability threshold of interest for futility monitoring
The target value to compare to in the one-sample case. Set to NULL for the two-sample case.
the total planned sample size at the end of the trial, c(N0, N1) for two-sample case; integer of total planned sample size at end of trial N for one-sample case
"greater" (default) if interest is in P(p1 > p0) and "less" if interest is in P(p1 < p0) for two-sample case. For one-sample case, "greater" if interest is in P(p > p0) and "less" if interest is in P(p < p0).
clinically meaningful difference between groups. Typically 0 for the two-sample case. NULL for the one-sample case (default).
the type of interim monitoring to be performed. One of "futility" or "efficacy". Default is "futility".
hyperparameters of prior beta distribution. Beta(0.5, 0.5) is default
number of samples, default is 5000