Skip to content

Latest commit

Β 

History

History
126 lines (109 loc) Β· 9.26 KB

File metadata and controls

126 lines (109 loc) Β· 9.26 KB

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

Quick Example

library(BayesERtools)
library(dplyr)
library(ggplot2)
theme_set(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) *
  coord_transform(x = "log10") *
  scale_x_continuous(
    breaks = xgxr::xgx_breaks_log10,
    minor_breaks = xgxr::xgx_minor_breaks_log10
  )

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.