Package: bonsaiforest2 0.1.0

Miriam Pedrera Gomez

bonsaiforest2: Flexible Bayesian Shrinkage Models for Subgroup Analysis

An extension of the 'bonsaiforest' package that provides increased flexibility in prior selection and modeling options. It supports four types of endpoints and simplifies the fitting and interpretation of Bayesian models for subgroup analysis. Leveraging 'brms', it distinguishes between prognostic and predictive factors using differential shrinkage priors and generates publication-ready forest plots.

Authors:Miriam Pedrera Gomez [aut, cre], Isaac Gravestock [aut], Marcel Wolbers [aut]

bonsaiforest2_0.1.0.tar.gz
bonsaiforest2_0.1.0.zip(r-4.7-any)bonsaiforest2_0.1.0.zip(r-4.6-any)bonsaiforest2_0.1.0.zip(r-4.5-any)
bonsaiforest2_0.1.0.tgz(r-4.6-any)bonsaiforest2_0.1.0.tgz(r-4.5-any)
bonsaiforest2_0.1.0.tar.gz(r-4.7-any)bonsaiforest2_0.1.0.tar.gz(r-4.6-any)
bonsaiforest2_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
bonsaiforest2/json (API)

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

Bug tracker:https://github.com/openpharma/bonsaiforest2/issues

Datasets:

On CRAN:

Conda:

5.93 score 141 scripts 6 exports 80 dependencies

Last updated from:18fddc8e2c. Checks:7 ERROR, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develERROR353
source / vignettesOK646
linux-releaseERROR370
macos-releaseERROR181
macos-oldrelERROR133
windows-develERROR165
windows-releaseERROR160
windows-oldrelERROR158
wasm-releaseOK266

Exports:combine_summariesestimate_subgroup_effectsfit_brms_modelprepare_formula_modelrun_brms_analysissummary_subgroup_effects

Dependencies:abindbackportsbayesplotBHbridgesamplingbrmsBrobdingnagcallrcheckmateclicodacodetoolscpp11descdigestdistributionaldplyrfarverfuturefuture.applygenericsggdistggplot2ggridgesglobalsgluegridExtragtableinlineisobandlabelinglatticelifecyclelistenvloomagrittrMatrixmatrixStatsmgcvmvtnormnleqslvnlmenumDerivotelparallellypillarpkgbuildpkgconfigplyrposteriorprocessxpspurrrquadprogQuickJSRR6RColorBrewerRcppRcppArmadilloRcppEigenRcppParallelreshape2rlangrstanrstantoolsS7scalessplines2StanHeadersstringistringrsurvivaltensorAtibbletidyrtidyselectutf8vctrsviridisLitewithr

Advanced Functionalities
Handling Exposure in Count Outcomes with Offsets | Example 1: Count outcome with offset | Customizing Prior Distributions | Model Preparation | Example 2: Using priors directly supported by brms | Example 3: Using the R2-D2 shrinkage prior | Example 4: Custom hierarchical prior (advanced) | Example 5: Coefficient-specific priors | Example 6: Hierarchical priors with shared variance (stanvars) | Stratification for nuisance parameters | Example 7: Fully stratified continuous one-way shrinkage model | Example 8: Stratified one-way survival model | Summary

Last update: 2026-09-30
Started: 2025-11-19

Statistical Specifications
Introduction | Model Specification and Fitting Step | Notation | Statistical model | Parameter grouping | Priors distributions for shrunken predictive terms | Normal priors for one-way shrinkage models | Regularized horseshoe priors for global shrinkage models | Model fitting | Standardization Step (G-Computation) | Comparison of One-way vs Global Shrinkage Models | References

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

Quickstart
Introduction | The Data | Choice of hyperprior parameters | One-way shrinkage models | One-way model for x1 | One-way model for x2 | One-way model for x3 | Forest plot of results from all one-way models | Global shrinkage model | Model fitting | Summary of subgroup effects | Global Model: Visualization | Comparing Multiple Models in One Plot | References

Last update: 2026-09-01
Started: 2025-11-17