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 |NEWS
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

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

Datasets:

On CRAN:

Conda:

5.97 score 1 stars 148 scripts 6 exports 79 dependencies

Last updated from:981609fc45. Checks:7 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK403
source / vignettesOK545
linux-releaseOK404
windows-develOK313
windows-releaseOK291
windows-oldrelOK454
wasm-releaseOK337

Exports:combine_summariesestimate_subgroup_effectsfit_brms_modelprepare_formula_modelrun_brms_analysissummary_subgroup_effects

Dependencies:abindbackportsbayesplotBHbridgesamplingbrmsBrobdingnagcallrcheckmateclicodacodetoolscpp11descdistributionaldplyrfarverfuturefuture.applygenericsggdistggplot2ggridgesglobalsgluegridExtragtableinlineisobandlabelinglatticelifecyclelistenvloomagrittrMatrixmatrixStatsmgcvmvtnormnleqslvnlmenumDerivotelparallellypillarpkgbuildpkgconfigplyrposteriorprocessxpspurrrquadprogQuickJSRR6RColorBrewerRcppRcppArmadilloRcppEigenRcppParallelreshape2rlangrstanrstantoolsS7scalessplines2StanHeadersstringistringrsurvivaltensorAtibbletidyrtidyselectutf8vctrsviridisLitewithr

Advanced Functionalities
Customizing Prior Distributions for Global Shrinkage Models | Example 1.1: Global model with a regularized horseshoe prior | Example 1.2: Global model with a normal prior and a common heterogeneity parameter | Example 1.3: Global model with a normal prior and separate heterogeneity parameters per subgrouping variable | Example 1.4: Global model with an R2-D2 prior | Example 1.5: Coefficient-specific priors | Stratification for nuisance parameters | Example 2.1: Fully stratified continuous one-way shrinkage model | Example 2.2: Stratified one-way survival model | Handling Exposure in Count Outcomes with Offsets | Example 3.1: Count outcome with offset | Summary

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

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-10-15
Started: 2025-11-17

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