1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Regression in R

Exercise

Predicting with interactions

As with every other regression model you've created, the fun part is making predictions. Fortunately, the code flow for this case is the same as the one without interactions—R can handle calculating the interactions without any extra prompting from you. The only thing you need to remember is the trick for getting combinations of explanatory variables.

mdl_price_vs_both_inter is available; dplyr and ggplot2 are loaded.

Instructions 1/3

undefined XP
    1
    2
    3

Make a grid of explanatory data, formed from combinations of the following variables.

  • n_convenience should take the numbers zero to ten.
  • house_age_years should take the unique values of the house_age_years column of taiwan_real_estate.