Package: goldilocks 1.1.0

goldilocks: Adaptive Trial Designs for Survival and Binary Endpoints

Implements Goldilocks adaptive trial designs for time-to-event and fixed-time binary endpoints. Outcomes are generated with a piecewise exponential model, with conjugate Gamma priors used for predictive imputation. Final analyses may use log-rank, Cox, or restricted mean survival time tests, Bayesian piecewise-exponential inference, frequentist risk differences, or Bayesian beta-binomial inference. The method closely follows Broglio and colleagues (2014) <doi:10.1080/10543406.2014.888569> and supports simulation of design operating characteristics. Complete trial paths can be simulated once and reused to calibrate stopping rules and final success thresholds without repeating predictive imputation or model fitting. Prespecified changes in endpoint timing use separate follow-up data cuts for success and futility prediction, with reusable simulation paths for schedule calibration.

Authors:Graeme L. Hickey [aut, cre], Ying Wan [aut], Thevaa Chandereng [aut], Becton, Dickinson and Company [cph], Tim Kacprowski [ctb]

goldilocks_1.1.0.tar.gz
goldilocks_1.1.0.zip(r-4.7-x86_64)goldilocks_1.1.0.zip(r-4.7-arm64)goldilocks_1.1.0.zip(r-4.6-x86_64)goldilocks_1.1.0.zip(r-4.6-arm64)goldilocks_1.1.0.zip(r-4.5-x86_64)
goldilocks_1.1.0.tgz(r-4.6-x86_64)goldilocks_1.1.0.tgz(r-4.6-arm64)goldilocks_1.1.0.tgz(r-4.5-x86_64)goldilocks_1.1.0.tgz(r-4.5-arm64)
goldilocks_1.1.0.tar.gz(r-4.7-arm64)goldilocks_1.1.0.tar.gz(r-4.7-x86_64)goldilocks_1.1.0.tar.gz(r-4.6-arm64)goldilocks_1.1.0.tar.gz(r-4.6-x86_64)
goldilocks_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
goldilocks/json (API)

# Install 'goldilocks' in R:
install.packages('goldilocks', repos = c('https://graemeleehickey.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/graemeleehickey/goldilocks/issues

Pkgdown/docs site:https://graemeleehickey.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

adaptivebayesianbayesian-statisticsclinical-trialsstatisticscpp

7.70 score 7 stars 57 scripts 470 downloads 26 exports 22 dependencies

Last updated from:6ec8dcfcf9. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK219
linux-devel-x86_64OK220
source / vignettesOK1104
linux-release-arm64OK222
linux-release-x86_64OK231
macos-release-arm64OK235
macos-release-x86_64OK457
macos-oldrel-arm64OK190
macos-oldrel-x86_64OK477
windows-devel-arm64OK360
windows-devel-x86_64OK235
windows-release-arm64OK322
windows-release-x86_64OK182
windows-oldrel-x86_64OK219
wasm-releaseOK124

Exports:apply_horizon_rulesapply_stopping_rulesenrollmentevaluate_interimplot_enrollmentplot_sim_decisionsplot_sim_ocsplot_sim_stoppingplot_trial_traceppweprob_to_hazprop_to_hazpwe_imputepwe_simrandomizationsim_comp_datasim_horizon_pathssim_horizon_trialssim_trialsim_trial_datasim_trial_pathssim_trialssummarise_calendar_timesummarise_simssummarise_trial_tracesurvival_adapt

Dependencies:BHclidplyrgenericsgluelatticelifecyclemagrittrMatrixpbmcapplypillarpkgconfigPWEALLR6Rcpprlangsurvivaltibbletidyselectutf8vctrswithr

ADVENT
Trial overview | Adaptive decision process | Endpoint scale | SAP event-time models and time units | Effectiveness endpoint | Safety endpoint | A reusable design specification | Graphical assessment of the simulated design | A fuller simulation template | SAP sensitivity assumptions and reference benchmarks | References

Last update: 2026-11-11
Started: 2026-07-05

ANTHEM-HFrEF
Clinical question and planned analysis | Planned design versus operational history | Source and status of every modeled input | Event-time and accrual assumptions | A one-trial goldilocks approximation | Small null and alternative simulation | Differences from the sponsor's design | References

Last update: 2026-11-11
Started: 2026-08-19

Applying predictive decisions to an observed interim data cut
Preparing the data cut | Evaluating the look | Using separate predictive and analysis priors | Using a prespecified RMST endpoint | Reviewing and retaining the audit trail

Last update: 2026-11-11
Started: 2026-08-31

Bayesian binary outcome designs
Two-arm design | Choosing the binary imputation approach | Single-arm design | Choosing bin_method | Operating characteristics

Last update: 2026-11-11
Started: 2026-07-05

Bayesian piecewise-exponential designs
When piecewise hazards help | Setting up the design | The Bayesian decision rule | Final analysis with incomplete follow-up | What a simulated trial dataset looks like | A single simulated trial | Notes on the piecewise model | Sensitivity to the cut-point specification | See also

Last update: 2026-11-11
Started: 2026-06-10

Calibrating stopping rules from complete trial paths
What is saved | Simulate null and alternative trial paths | Evaluate candidate rules | Two distinct futility measures | Review individual decisions | Check for calculation failures | Save and reuse the trial paths

Last update: 2026-11-11
Started: 2026-11-03

Frequentist binary outcome designs
Choosing the analysis | Example design | Pending and missing endpoint outcomes | Reference

Last update: 2026-11-11
Started: 2026-09-04

Inspecting adaptive decision paths
Reviewing one trial's interim history | Visualizing the enrollment plan | Plotting the interim decision path | Summarizing many simulated trials

Last update: 2026-11-11
Started: 2026-07-10

PROMISE II
Planned design and final analysis | Interim decisions | Event times, dropout, and enrollment | Predictive imputation and a package example | Reconstructing the operating characteristics | Sensitivity to enrollment | Supporting fixed-sample calculations | Reproducing the results | References

Last update: 2026-11-11
Started: 2026-11-10

Restricted mean survival time designs
Effect and hypothesis | A trial with a delayed treatment effect | Prediction and loss to follow-up | Evaluate the design | References

Last update: 2026-11-11
Started: 2026-09-08

Single-arm designs with a performance goal
The decision rule | Setting up the design | Operating characteristics | A practical caveat on benchmarks | See also

Last update: 2026-11-11
Started: 2026-06-10

Statistical workflow and reproducibility
Overview | From assumptions to operating characteristics | Data-generating assumptions | Interim prediction | Bayesian survival calculation | Completed-data analysis | Summaries for design evaluation | Prespecification and reproducibility | Implementation map

Last update: 2026-11-11
Started: 2026-06-09

Technical details of the Goldilocks design
Overview | 1. Design and notation | 2. Continuous-time enrollment process | 3. Event-time model | 3.1 Independent dropout and administrative censoring | 4. Posterior distribution of hazards | $$\pi(\boldsymbol{\lambda} \mid \mathcal{D}) | 5. Predictive distribution for incomplete outcomes | $$p(\mathcal{D}^{\mathrm{mis}} \mid \mathcal{D}_{\ell}^{\mathrm{obs}}) | 6. Interim decision rule | 6.1 Predictive probability at the current sample size | $$P_ | 6.2 Predictive probability at the maximum sample size | $$P_ | 7. Final analysis | 7.1 Frequentist final tests | 7.2 Bayesian survival final test | $$\Delta^ | \left[1 - \exp{-H_1^{(b)}(\tau)}\right] | $$\widehat{\Pr}(\Delta < h_0 \mid \mathcal{D}) | 7.3 Bayesian binary final test | 7.4 Loss to follow-up at the final analysis | 8. Operating characteristics | 8.1 Graphical assessment | 9. Threshold selection | 10. Relation to group-sequential designs | 11. Scope and statistical limitations | References

Last update: 2026-11-11
Started: 2026-06-16

ThermoCool AF
Trial and endpoint | The reported stopping rules | The four-way goldilocks rule | Source and status of modeled inputs | Mapping the longitudinal analysis model | Published design-generating assumptions | Assumptions versus the reported trial history | One simulated trial | Small operating-characteristic demonstration | Operating-characteristic evaluation | What this example does and does not reproduce | Sources and document roles

Last update: 2026-11-11
Started: 2026-09-04

Technical details of prespecified endpoint horizons
Design specification | Two data cuts at the same calendar date | Predictive hazard models and completed-data analyses | Gamma updating within each data cut | Predictive completion and success scores | Stopping and final analysis | Shared histories, dropout, and timing | Analysis and decision dates | Reusing trial paths for calibration | How the schedule determines saved horizons | Interpreting the two futility measures | Type I error across endpoint times | References

Last update: 2026-11-11
Started: 2026-11-09

Calibrating prob_ha for type I error control
Design and null scenario | Screening a candidate grid | Plotting the calibration curve | Independent validation | Extending the calibration | Calibrating an RMST design

Last update: 2026-11-11
Started: 2026-09-05

Two-arm randomized trials
Design assumptions | Final analysis and hypotheses | One-sided tests | Simulation settings | Power and type I error | Calibrating the final threshold | Calendar time and follow-up | Graphical assessment | References

Last update: 2026-11-11
Started: 2026-07-12

Extending an endpoint from 12 to 18 months
Specify the endpoint schedule | Define the generating and analysis assumptions | Simulate all looks and both horizons | Examine operating characteristics | Benefit at 12 months but no benefit at 18 months | Inspect a trial and its two predictive models | Compare an earlier switch using the same paths | Optional endpoint-specific margins | Direct simulation and analysis dates | Add dropout or save results

Last update: 2026-11-10
Started: 2026-11-09

Readme and manuals

Help Manual

Help pageTopics
Apply a prespecified endpoint schedule to saved trial pathsapply_horizon_rules
Apply stopping rules to saved trial pathsapply_stopping_rules
Simulate exact continuous-time enrollmentenrollment
Evaluate an externally observed interim data cutevaluate_interim
Goldilocks Bayesian adaptive trial designsgoldilocks
Plot an enrollment projectionplot_enrollment
Plot predictive-probability decision mapsplot_sim_decisions
Plot operating characteristics across simulation scenariosplot_sim_ocs
Plot stopping outcomes from trial simulationsplot_sim_stopping
Plot predictive probabilities and enrollment at interim looksplot_trial_trace
Calculate endpoint event probabilities from piecewise hazardsppwe
Print a calendar-time operating-characteristic summaryprint.goldilocks_calendar_summary
Print trial paths with multiple endpoint horizonsprint.goldilocks_horizon_paths
Print an externally evaluated interim analysisprint.goldilocks_interim
Print a set of complete trial pathsprint.goldilocks_paths
Print a Goldilocks adaptive trial resultprint.goldilocks_trial
Derive piecewise-constant hazard rates from cumulative event probabilitiesprob_to_haz prop_to_haz
Impute piecewise exponential time-to-event outcomespwe_impute
Simulate piecewise exponential time-to-event outcomespwe_sim
Generate a block-randomized treatment sequencerandomization
Simulate complete trial paths for prespecified endpoint horizonssim_horizon_paths
Simulate trials with a prespecified endpoint-horizon schedulesim_horizon_trials
Simulate and analyze one Goldilocks adaptive trialsim_trial survival_adapt
Simulate complete trial data under piecewise-exponential event ratessim_comp_data sim_trial_data
Simulate complete trial paths for repeated threshold calibrationsim_trial_paths
Estimate operating characteristics by trial simulationsim_trials
Summarize operating characteristics on the calendar-time scalesummarise_calendar_time
Estimate operating characteristics from trial simulationssummarise_sims
Summarize an interim decision pathsummarise_trial_trace