Session Ready
Exercise

Predicting with a parallel slopes model

While ggplot can automatically show you model predictions, in order to get those values to program with, you'll need to do the calculations yourself.

Just as with the case of a single explanatory variable, the workflow has two steps: create a data frame of explanatory variables, then add a column of predictions. To make sure you've got the right answer, you can add your predictions to the ggplot with the geom_parallel_slopes() lines.

taiwan_real_estate and mdl_price_vs_both are available; dplyr, tidyr, 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.