Session Ready
Exercise

Interactions with understandable coeffs

The previous model with the interaction term returned coefficients that were a little tricky to interpret. In order clarify what the model is predicting, you can reformulate the model in a way that returns understandable coefficients. For further clarity, you can compare the results to the models on the separate house age categories (mdl_0_to_15, mdl_15_to_30, and mdl_30_to_45).

taiwan_real_estate, mdl_0_to_15, mdl_15_to_30, and mdl_30_to_45 are available.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Fit a linear regression of price_twd_msq versus house_age_years plus an interaction between n_convenience and house_age_years, and no global intercept, using the taiwan_real_estate dataset.
  • For comparison, print the coefficients for the three models for each category: mdl_0_to_15, mdl_15_to_30, and mdl_30_to_45.