Creates a frozen specification of a sequential Bayesian analysis
before data collection: the model, the analysis priors, the
monitored effect, the decision metric, the stopping thresholds, and the
planned look schedule. The returned object is used both to simulate the
design's operating characteristics (brms_inla_sequential_trial()) and to
monitor the real study as data accumulate (sequential_analysis()).
The object carries an MD5 fingerprint of all decision-relevant fields. Quoting this fingerprint in a preregistration or protocol allows readers and reviewers to verify that the stopping rules were not altered after data collection began: any change to the model, priors, metric, thresholds, or look schedule produces a different fingerprint.
sequential_design(
formula,
family = gaussian(),
priors = NULL,
effect_name,
metric = c("direction", "threshold", "rope"),
alternative = c("greater", "less"),
looks,
prob_success = 0.95,
prob_futility = NULL,
effect_threshold = 0,
rope_bounds = NULL,
credible_level = 0.95,
label = NULL
)A list of class "powerbrmsINLA_seq_design" whose fingerprint
element contains the MD5 hash of the decision-relevant fields.
Model formula (brms syntax; random effects supported).
Response family, e.g. gaussian(), binomial().
Optional brms prior specification (translated to INLA via
the package's prior bridge; see brms_inla_power()).
Single character: the monitored fixed effect.
"direction", "threshold", or "rope".
"greater" or "less": the prespecified direction for
the direction/threshold metrics. Ignored for "rope".
Strictly increasing vector of cumulative sample sizes (total observations) at which interim analyses are planned. The final element is the maximum sample size.
Scalar or length(looks) vector of stop-for-success
posterior probability thresholds in (0.5, 1). Per-look vectors allow
stricter early thresholds (O'Brien-Fleming-like behaviour).
Scalar or length(looks) vector of stop-for-futility
thresholds in (0, 0.5), or NULL (default) for no futility stopping.
Ignored with a warning for metric = "rope".
Threshold for metric = "threshold" (model
coefficient scale).
Length-2 increasing numeric vector for
metric = "rope".
Credible level for reported intervals (default 0.95).
Optional character label for the study (used in printing).
Because Bayesian posterior quantities obey the likelihood principle, the
interpretation of the posterior at the final look does not depend on the
stopping rule. The frequency properties of the design (false-go
rate, expected sample size, exaggeration of estimates at early stops) do.
The recommended workflow is therefore: (1) create the design; (2) estimate
its operating characteristics by simulation with
brms_inla_sequential_trial(); (3) preregister the design, including its
fingerprint; (4) monitor the study with sequential_analysis(); and
(5) report the final posterior alongside the simulated operating
characteristics.
sequential_analysis(), brms_inla_sequential_trial(),
plot_sequential_monitor()
design <- sequential_design(
formula = strength ~ group,
effect_name = "group",
metric = "threshold",
effect_threshold = 0.2,
looks = c(40, 80, 120, 160, 200),
prob_success = 0.95,
prob_futility = 0.05,
label = "Periodisation RCT"
)
print(design)
Run the code above in your browser using DataLab