BayesERbook: Exposure-response analysis with Bayesian approaches

Authors

Kenta Yoshida

François Mercier

Published

2025-02-10

Welcome

This book provides examples of exposure-response analysis with Bayesian methods.

Install necessary packages BayesERtools website

The examples utilizes BayesERtools package.

You can install the package as follows:

install.packages('BayesERtools')
# devtools::install_github("genentech/BayesERtools") # development version

You also need latest version of rstanemax (>= 0.1.7) to use Emax model.

install.packages('rstanemax', repos = c(ppm = 'https://packagemanager.posit.co/cran/latest'))

Model types supported by BayesERtools

Binary endpoint
Continuous endpoint
Linear (logit) Emax (logit) Linear Emax
backend rstanarm rstanemax rstanarm rstanemax
reference πŸ”— πŸ”— πŸ”— πŸ”—
develop model βœ… βœ… βœ… βœ…
simulate & plot ER βœ… βœ… βœ… βœ…
exposure metrics selection βœ… βœ… βœ… βœ…
covariate selection βœ… ❌ βœ… ❌
covariate forest plot βœ… ❌ 🟑 ❌
βœ… Available, 🟑 In plan/under development, ❌ Not in a current plan

Note for developer

Run usethis::use_tidy_style(strict = FALSE) before committing to ensure that the code is formatted appropriately.

Session info

Show the code
devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.3 (2024-02-29)
 os       macOS Sonoma 14.7.2
 system   aarch64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Los_Angeles
 date     2025-02-10
 pandoc   3.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package        * version    date (UTC) lib source
 abind            1.4-8      2024-09-12 [1] CRAN (R 4.3.3)
 arrayhelpers     1.1-0      2020-02-04 [1] CRAN (R 4.3.0)
 backports        1.5.0      2024-05-23 [1] CRAN (R 4.3.3)
 BayesERtools   * 0.1.6.7002 2024-12-11 [1] RSPM (R 4.3.3)
 bayesplot      * 1.11.1     2024-02-15 [1] CRAN (R 4.3.1)
 bayestestR       0.13.2     2024-02-12 [1] CRAN (R 4.3.1)
 cachem           1.1.0      2024-05-16 [1] CRAN (R 4.3.3)
 checkmate        2.3.2      2024-07-29 [1] CRAN (R 4.3.3)
 cli              3.6.3      2024-06-21 [1] CRAN (R 4.3.3)
 coda             0.19-4.1   2024-01-31 [1] CRAN (R 4.3.1)
 colorspace       2.1-1      2024-07-26 [1] CRAN (R 4.3.3)
 devtools         2.4.5      2022-10-11 [1] CRAN (R 4.3.0)
 digest           0.6.36     2024-06-23 [1] CRAN (R 4.3.3)
 distributional   0.5.0      2024-09-17 [1] CRAN (R 4.3.3)
 dplyr          * 1.1.4      2023-11-17 [1] CRAN (R 4.3.1)
 ellipsis         0.3.2      2021-04-29 [1] RSPM (R 4.3.0)
 evaluate         0.24.0     2024-06-10 [1] CRAN (R 4.3.3)
 fansi            1.0.6      2023-12-08 [1] RSPM (R 4.3.0)
 fastmap          1.2.0      2024-05-15 [1] CRAN (R 4.3.3)
 forcats        * 1.0.0      2023-01-29 [1] RSPM (R 4.3.0)
 fs               1.6.4      2024-04-25 [1] CRAN (R 4.3.1)
 generics         0.1.3      2022-07-05 [1] RSPM (R 4.3.0)
 ggdist           3.3.2      2024-03-05 [1] CRAN (R 4.3.1)
 ggplot2        * 3.5.1      2024-04-23 [1] CRAN (R 4.3.1)
 glue             1.7.0      2024-01-09 [1] RSPM (R 4.3.0)
 gt             * 0.11.0     2024-07-09 [1] CRAN (R 4.3.3)
 gtable           0.3.5      2024-04-22 [1] CRAN (R 4.3.1)
 here           * 1.0.1      2020-12-13 [1] RSPM (R 4.3.0)
 hms              1.1.3      2023-03-21 [1] RSPM (R 4.3.0)
 htmltools        0.5.8.1    2024-04-04 [1] CRAN (R 4.3.1)
 htmlwidgets      1.6.4      2023-12-06 [1] RSPM (R 4.3.0)
 httpuv           1.6.15     2024-03-26 [1] CRAN (R 4.3.1)
 insight          0.20.1     2024-06-11 [1] CRAN (R 4.3.3)
 jsonlite         1.8.9      2024-09-20 [1] CRAN (R 4.3.3)
 knitr            1.48       2024-07-07 [1] CRAN (R 4.3.3)
 later            1.3.2      2023-12-06 [1] RSPM (R 4.3.0)
 lattice          0.22-5     2023-10-24 [1] CRAN (R 4.3.3)
 lifecycle        1.0.4      2023-11-07 [1] RSPM (R 4.3.0)
 loo            * 2.7.0      2024-02-24 [1] CRAN (R 4.3.1)
 lubridate      * 1.9.3      2023-09-27 [1] RSPM (R 4.3.0)
 magrittr         2.0.3      2022-03-30 [1] RSPM (R 4.3.0)
 matrixStats      1.4.1      2024-09-08 [1] CRAN (R 4.3.3)
 memoise          2.0.1      2021-11-26 [1] RSPM (R 4.3.0)
 mime             0.12       2021-09-28 [1] RSPM (R 4.3.0)
 miniUI           0.1.1.1    2018-05-18 [1] RSPM (R 4.3.0)
 munsell          0.5.1      2024-04-01 [1] CRAN (R 4.3.1)
 pillar           1.9.0      2023-03-22 [1] RSPM (R 4.3.0)
 pkgbuild         1.4.3      2023-12-10 [1] RSPM (R 4.3.0)
 pkgconfig        2.0.3      2019-09-22 [1] RSPM (R 4.3.0)
 pkgload          1.3.4      2024-01-16 [1] RSPM (R 4.3.0)
 posterior      * 1.6.0      2024-07-03 [1] CRAN (R 4.3.3)
 profvis          0.3.8      2023-05-02 [1] CRAN (R 4.3.0)
 promises         1.3.0      2024-04-05 [1] CRAN (R 4.3.1)
 purrr          * 1.0.2      2023-08-10 [1] RSPM (R 4.3.0)
 R6               2.5.1      2021-08-19 [1] RSPM (R 4.3.0)
 Rcpp             1.0.13     2024-07-17 [1] CRAN (R 4.3.3)
 readr          * 2.1.5      2024-01-10 [1] RSPM (R 4.3.0)
 remotes          2.5.0      2024-03-17 [1] CRAN (R 4.3.1)
 rlang            1.1.4      2024-06-04 [1] CRAN (R 4.3.3)
 rmarkdown        2.27       2024-05-17 [1] CRAN (R 4.3.3)
 rprojroot        2.0.4      2023-11-05 [1] RSPM (R 4.3.0)
 rstudioapi       0.16.0     2024-03-24 [1] CRAN (R 4.3.1)
 scales           1.3.0      2023-11-28 [1] RSPM (R 4.3.0)
 sessioninfo      1.2.2      2021-12-06 [1] CRAN (R 4.3.0)
 shiny            1.9.1      2024-08-01 [1] CRAN (R 4.3.3)
 stringi          1.8.4      2024-05-06 [1] CRAN (R 4.3.1)
 stringr        * 1.5.1      2023-11-14 [1] RSPM (R 4.3.0)
 svUnit           1.0.6      2021-04-19 [1] CRAN (R 4.3.0)
 tensorA          0.36.2.1   2023-12-13 [1] CRAN (R 4.3.1)
 tibble         * 3.2.1      2023-03-20 [1] RSPM (R 4.3.0)
 tidybayes      * 3.0.6      2023-08-12 [1] CRAN (R 4.3.0)
 tidyr          * 1.3.1      2024-01-24 [1] RSPM (R 4.3.0)
 tidyselect       1.2.1      2024-03-11 [1] CRAN (R 4.3.1)
 tidyverse      * 2.0.0      2023-02-22 [1] RSPM (R 4.3.0)
 timechange       0.3.0      2024-01-18 [1] RSPM (R 4.3.0)
 tzdb             0.4.0      2023-05-12 [1] RSPM (R 4.3.0)
 urlchecker       1.0.1      2021-11-30 [1] CRAN (R 4.3.0)
 usethis          2.2.3      2024-02-19 [1] CRAN (R 4.3.1)
 utf8             1.2.4      2023-10-22 [1] RSPM (R 4.3.0)
 vctrs            0.6.5      2023-12-01 [1] RSPM (R 4.3.0)
 withr            3.0.1      2024-07-31 [1] CRAN (R 4.3.3)
 xfun             0.46       2024-07-18 [1] CRAN (R 4.3.3)
 xml2             1.3.6      2023-12-04 [1] RSPM (R 4.3.0)
 xtable           1.8-4      2019-04-21 [1] RSPM (R 4.3.0)
 yaml             2.3.10     2024-07-26 [1] CRAN (R 4.3.3)

 [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library

──────────────────────────────────────────────────────────────────────────────