Couldn’t figure out how to edit pp_check plots.
How can I change two things on the plot?
- Point size of yrep on the plot?
- Column/bar width?
Data
library(tidyverse)
n = 100
a = tibble(sex = rep(c("m", "m", "m", "m", "m", "m", "m", "f", "f", "f"), length.out = n), year = rep(c(3, 4, 5), length.out = n))
b = tibble(sex = rep(c("m", "m", "m", "m", "m", "m", "f", "f", "f", "f"), length.out = n), year = rep(c(2, 3, 4), length.out = n))
c = tibble(sex = rep(c("m", "m", "m", "m", "m", "f", "f", "f", "f", "f"), length.out = n), year = rep(c(1, 2, 3), length.out = n))
d = tibble(sex = rep(c("m", "m", "m", "m", "f", "f", "f", "f", "f", "f"), length.out = n), year = rep(c(0, 1, 2), length.out = n))
e = rbind(a, b)
f = rbind(e, c)
df = rbind(f, d)
df = df %>% mutate(sex = as.factor(sex))
df %>% ggplot(aes(year, fill = sex)) + geom_bar(position = "fill") + ylab("proportion") + scale_fill_manual(values = c("red", "skyblue"))
Model and pp_check
m = brm(sex ~ year, family = "bernoulli", data = df)
m %>% pp_check(type = c("bars"))