This book provides examples of exposure-response analysis with Bayesian methods.
The examples utilizes
BayesERtools package.
- Tutorial (
BayesERbook): https://genentech.github.io/BayesERbook/ - Package documentation: https://genentech.github.io/BayesERtools/
- GitHub repo of the package: https://github.com/genentech/BayesERtools/
You can install the package as follows:
install.packages('BayesERtools')
# devtools::install_github("genentech/BayesERtools") # development versionlibrary(BayesERtools)
library(dplyr)
ggplot2::theme_set(ggplot2::theme_bw(base_size = 12))
# Data
data(d_sim_binom_cov)
df_er_ae_hgly2 <-
d_sim_binom_cov |>
mutate(AUCss_1000 = AUCss / 1000) |>
filter(AETYPE == "hgly2")
# Fit a model
ermod <- dev_ermod_bin(
data = df_er_ae_hgly2,
var_resp = "AEFLAG",
var_exposure = "AUCss_1000"
)
# Goodness-of-fit plot
plot_er_gof(ermod, var_group = "Dose_mg", show_coef_exp = TRUE) *
xgxr::xgx_scale_x_log10(guide = ggplot2::guide_axis(minor.ticks = TRUE))|
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 | ||||
Run usethis::use_tidy_style(strict = FALSE) before committing to
ensure that the code is formatted appropriately.

