Session Ready
Exercise

Inflation and interaction

Often including an interaction among the explanatory variables can reduce prediction errors. As a rule, the smaller the prediction error, the tighter will be the confidence interval on an effect size. This can be offset, however, when there is collinearity introduced by the interaction.

In this exercise, you'll work with used car data to see an example of how the cross-validated prediction error of price can be greatly reduced by including an interaction term between age and mileage. But, because of collinearity, you'll see that the reduction in prediction error does not lead to a narrower confidence interval.

Instructions
100 XP
  • Train two linear models on the Used_Ford data: one with Price ~ Age + mileage and the other with an interaction included: Price ~ Age * Mileage.
  • Find the cross-validated prediction errors for the two models and confirm that the interaction substantially reduces prediction error.
  • For each of the two models, calculate a 95% confidence interval on the effect of Age on Price.
  • Look at the collinearity inflation factors to see why the interaction did not narrow the confidence interval even though it improved prediction error.