brm_plot_draws {brms.mmrm} | R Documentation |
Visualize posterior draws of marginals.
Description
Visualize posterior draws of marginals.
Usage
brm_plot_draws(draws, axis = "time", facet = c("group", "subgroup"))
Arguments
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 |
Value
A ggplot
object.
See Also
Other visualization:
brm_plot_compare()
Examples
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)
}