I have generated posterior predictive distributions (on the outcome scale) for a multilevel varying intercepts Poisson-GLM with five categories along the lines described in the Stan User’s Guide, Sec. 24.5.2 (24.5 Posterior prediction for regressions | Stan User’s Guide). Now, as a form of model validation, I’d like to use bayesplot or ggplot2 to overlay the observed Poisson-like distributions in the five categories with examples of the sampled posterior predictive distributions in each category, employing a combination of geom_bar(), facet_wrap() and an (hopefully existing) analog of geom_jitter() to shift the bars inside each plot slightly so they don’t overlap.
Can anyone point me to existing functions in bayesplot (I am not really making good progress with ppc_bars_grouped() and the likes as they require the observed predictor data as input rather than counterfactual data) or any good reference elsewhere to help me along with my objective? Any suggestions are much appreciated. Many thanks.