View source: R/brm_plot_draws.R
brm_plot_draws | R Documentation |
Visualize posterior draws of marginals.
brm_plot_draws(draws, axis = "time", facet = c("group", "subgroup"))
draws |
A data frame of draws from an element of
the output list of |
axis |
Character of length 1 identifying the quantity to put
on the horizontal axis. Must be be one of |
facet |
Character vector of length 1 or 2 with quantities to
generate facets. Each element must be |
A ggplot
object.
Other visualization:
brm_plot_compare()
if (identical(Sys.getenv("BRM_EXAMPLES", unset = ""), "true")) {
set.seed(0L)
data <- brm_data(
data = brm_simulate_simple()$data,
outcome = "response",
group = "group",
time = "time",
patient = "patient",
reference_group = "group_1",
reference_time = "time_1"
)
formula <- brm_formula(
data = data,
baseline = FALSE,
baseline_time = FALSE
)
tmp <- utils::capture.output(
suppressMessages(
suppressWarnings(
model <- brm_model(
data = data,
formula = formula,
chains = 1,
iter = 100,
refresh = 0
)
)
)
)
draws <- brm_marginal_draws(data = data, formula = formula, model = model)
brm_plot_draws(draws = draws$difference_time)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.