# NOT RUN {
y <- rnorm(50)
yrep <- matrix(rnorm(5000, 0, 2), ncol = 50)
color_scheme_set("brightblue")
ppc_ribbon(y, yrep)
ppc_intervals(y, yrep)
color_scheme_set("teal")
year <- 1950:1999
ppc_ribbon(y, yrep, x = year, alpha = 0, size = 0.75) + ggplot2::xlab("Year")
color_scheme_set("pink")
year <- rep(2000:2009, each = 5)
group <- gl(5, 1, length = 50, labels = LETTERS[1:5])
ppc_ribbon_grouped(y, yrep, x = year, group) +
ggplot2::scale_x_continuous(breaks = pretty)
ppc_ribbon_grouped(
y, yrep, x = year, group,
facet_args = list(scales = "fixed"),
alpha = 1,
size = 2
) +
xaxis_text(FALSE) +
xaxis_ticks(FALSE) +
panel_bg(fill = "gray20")
# }
# NOT RUN {
library("rstanarm")
fit <- stan_glmer(mpg ~ wt + (1|cyl), data = mtcars)
yrep <- posterior_predict(fit)
color_scheme_set("purple")
with(mtcars, ppc_intervals(mpg, yrep, x = wt, prob = 0.5)) +
panel_bg(fill="gray90", color = NA) +
grid_lines(color = "white")
ppc_intervals_grouped(y = mtcars$mpg, yrep, prob = 0.8,
x = mtcars$wt, group = mtcars$cyl)
color_scheme_set("gray")
ppc_intervals(mtcars$mpg, yrep, prob = 0.5) +
ggplot2::scale_x_continuous(
labels = rownames(mtcars),
breaks = 1:nrow(mtcars)
) +
xaxis_text(angle = -70, vjust = 1, hjust = 0)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab