Posterior Predictive Test-Statistic Distribution Plot
Source:R/ppc_visualization.R
plot_ppc_stat.RdWraps bayesplot::ppc_stat() with consistent styling via theme_ppc().
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().
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")
# }