View source: R/sequential-analysis.R
| sequential_design | R Documentation |
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
)
formula |
Model formula (brms syntax; random effects supported). |
family |
Response family, e.g. |
priors |
Optional brms prior specification (translated to INLA via
the package's prior bridge; see |
effect_name |
Single character: the monitored fixed effect. |
metric |
|
alternative |
|
looks |
Strictly increasing vector of cumulative sample sizes (total observations) at which interim analyses are planned. The final element is the maximum sample size. |
prob_success |
Scalar or |
prob_futility |
Scalar or |
effect_threshold |
Threshold for |
rope_bounds |
Length-2 increasing numeric vector for
|
credible_level |
Credible level for reported intervals (default 0.95). |
label |
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.
A list of class "powerbrmsINLA_seq_design" whose fingerprint
element contains the MD5 hash of the decision-relevant fields.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.