Skip to contents

Wraps bayesplot::ppc_stat() with consistent styling via theme_ppc().

Usage

plot_ppc_stat(y_obs, y_rep, stat = "mean", ...)

Arguments

y_obs

Numeric vector of length \(n\).

y_rep

Numeric matrix of dimension \(S \times n\).

stat

Character string naming the test statistic. Currently supported values: "mean" and "sd". Defaults to "mean".

...

Additional arguments passed to bayesplot::ppc_stat().

Value

A ggplot2 object.

Examples

set.seed(3)
y     <- rnorm(80, mean = 1, sd = 1)
draws <- matrix(rnorm(300 * 80, mean = 1), nrow = 300, ncol = 80)
y_rep <- simulate_ppc(draws)
# \donttest{
  p <- plot_ppc_stat(y, y_rep, stat = "sd")
# }