# NOT RUN {
y <- example_y_data()
yrep <- example_yrep_draws()
ppc_stat(y, yrep)
ppc_stat(y, yrep, stat = "sd") + legend_none()
ppc_stat_2d(y, yrep)
ppc_stat_2d(y, yrep, stat = c("median", "mean")) + legend_move("bottom")
color_scheme_set("teal")
group <- example_group_data()
ppc_stat_grouped(y, yrep, group)
color_scheme_set("mix-red-blue")
ppc_stat_freqpoly_grouped(y, yrep, group)
# use your own function to compute test statistics
color_scheme_set("brightblue")
q25 <- function(y) quantile(y, 0.25)
ppc_stat(y, yrep, stat = "q25") # legend includes function name
# can define the function in the 'stat' argument but then
# the legend doesn't include a function name
ppc_stat(y, yrep, stat = function(y) quantile(y, 0.25))
# }
Run the code above in your browser using DataLab