Calculating deviance and information criteria

Calculating information criteria in R is simple. AIC, BIC, DIC, WAIC, and others are included in the base installation of R.

To see how it is done, we will estimate some models using the US income data.

We will predict log income using standardized age, and occupational prestige.

Look at the deviance for all three models.

Even though the coefficients for age and occupational prestige are almost identical, the latter provides a much better fit with the data.

Next we will compute the AIC and WAIC for the three models.

Notice that in this case, the two measures are very similar. This is because we have relatively uninformative priors, many observations, and our posterior is approximately normal.

We can also use the compare function to easily compare multiple WAIC values.

The model with both predictors is the unambiguous winner.

We can use this method to see which is a better predictor of income, college education or high-school education (controlling for age, occupational prestige, and gender).