Given a set of observed data including a quantitative response variable y and an rstanreg model of y, this function returns 4 measures of the posterior prediction quality. Median absolute prediction error (mae) measures the typical difference between the observed y values and their posterior predictive medians (stable = TRUE) or means (stable = FALSE). Scaled mae (mae_scaled) measures the typical number of absolute deviations (stable = TRUE) or standard deviations (stable = FALSE) that observed y values fall from their predictive medians (stable = TRUE) or means (stable = FALSE). within_50 and within_90 report the proportion of observed y values that fall within their posterior prediction intervals, the probability levels of which are set by the user.
model: an rstanreg model object with quantitative y
data: data frame including the variables in the model, both response y and predictors x
prob_inner: posterior predictive interval probability (a value between 0 and 1)
prob_outer: posterior predictive interval probability (a value between 0 and 1)
stable: TRUE returns the number of absolute deviations and FALSE returns the standard deviations that observed y values fall from their predictive medians