10.5 Posterior Predictive check

Use the pp_check() function from {bayesplot} package included in the {rstanarm} package. It compares the observed outcome variable y to simulated datasets from the posterior predictive distribution.

# Examine 50 of the 20000 simulated samples
pp_check(bike_model,nreps = 50) + 
  xlab("rides")+
  labs(title="50 datasets of ridership simulated from the posterior (light blue)\nalongside the actual observed ridership data (dark blue)")