Nothing
## ----include = FALSE----------------------------------------------------------
has_erglm <- requireNamespace("erglm", quietly = TRUE)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 7,
fig.height = 5,
eval = has_erglm
)
## ----echo = FALSE, results = "asis", eval = !has_erglm------------------------
# cat(
# "**Note:** the erglm package is not installed, so the code in this",
# "vignette was not evaluated. Install erglm to see the output for",
# "yourself: `install.packages(\"erglm\")`."
# )
## ----setup--------------------------------------------------------------------
library(erplots)
library(erglm)
## -----------------------------------------------------------------------------
head(erglm_data)
## ----fit-mod------------------------------------------------------------------
mod <- erglm_model(ae1 ~ aucss, erglm_data, family = binomial())
## ----er-plot-empty------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1)
## ----er-plot-empty-2----------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
plot()
## ----add-model----------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
er_plot_add_model(mod) |>
plot()
## ----add-quantiles------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
er_plot_add_model(mod) |>
er_plot_add_quantiles() |>
plot()
## ----add-data-----------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
er_plot_add_model(mod) |>
er_plot_add_quantiles() |>
er_plot_add_data() |>
plot()
## ----add-summary--------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
er_plot_add_model(mod) |>
er_plot_add_quantiles() |>
er_plot_add_summary(model = mod) |>
plot()
## ----add-groups---------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
er_plot_add_model(mod) |>
er_plot_add_quantiles() |>
er_plot_add_groups(group_by = treatment) |>
plot()
## ----full-example, fig.height = 8---------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1) |>
er_plot_add_model(mod) |>
er_plot_add_quantiles() |>
er_plot_add_data() |>
er_plot_add_summary(model = mod) |>
er_plot_add_groups(group_by = c(treatment, sex)) |>
plot()
## ----stratify-----------------------------------------------------------------
mod_strat <- erglm_model(ae1 ~ aucss + sex, erglm_data, family = binomial())
erglm_data |>
er_plot(exposure = aucss, response = ae1, stratify_by = sex) |>
er_plot_add_model(mod_strat) |>
er_plot_add_quantiles() |>
er_plot_add_data() |>
plot()
## ----continuous---------------------------------------------------------------
mod_cont <- erglm_model(biomarker_change ~ aucss, erglm_data, family = gaussian())
erglm_data |>
er_plot(exposure = aucss, response = biomarker_change) |>
er_plot_add_model(mod_cont) |>
er_plot_add_quantiles() |>
er_plot_add_data() |>
plot()
## ----count--------------------------------------------------------------------
mod_count <- erglm_model(ae_count ~ aucss, erglm_data, family = poisson())
erglm_data |>
er_plot(exposure = aucss, response = ae_count, response_type = "count") |>
er_plot_add_model(mod_count) |>
er_plot_add_quantiles() |>
er_plot_add_data() |>
plot()
## ----theme--------------------------------------------------------------------
erglm_data |>
er_plot(exposure = aucss, response = ae1, stratify_by = sex) |>
er_plot_add_model(mod_strat) |>
er_plot_add_quantiles() |>
er_plot_add_data() |>
er_plot_theme(
xlab = "Steady-state AUC",
theme_base = ggplot2::theme_minimal(),
color_discrete = ggplot2::scale_colour_brewer(palette = "Dark2"),
fill_discrete = ggplot2::scale_fill_brewer(palette = "Dark2")
) |>
plot()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.