Model fit with posterior predictive model checks

Bayesian Regression Modeling with rstanarm

Jake Thompson

Psychometrician, ATLAS, University of Kansas

R squared posterior distribution

stan_model <- stan_glm(kid_score ~ mom_iq, data = kidiq)
r2_posterior <- bayes_R2(stan_model)

summary(r2_posterior)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.09677 0.18034 0.20006 0.20042 0.22048 0.33414
quantile(r2_posterior, probs = c(0.025, 0.975))
     2.5%     97.5% 
0.1402846 0.2619605
Bayesian Regression Modeling with rstanarm

R squared histogram

hist(r2_posterior)

Bayesian Regression Modeling with rstanarm

Density overlay

pp_check(stan_model, "dens_overlay")

Bayesian Regression Modeling with rstanarm

Posterior predictive tests

pp_check(stan_model, "stat")

Bayesian Regression Modeling with rstanarm

Posterior predictive tests

pp_check(stan_model, "stat_2d")

Bayesian Regression Modeling with rstanarm

Let's practice!

Bayesian Regression Modeling with rstanarm

Preparing Video For Download...