Session Ready
Exercise

Calculating total change

In the previous exercise, you built a model of house prices that left out a clearly important variable: living_area. You did this so you could let living_area change as it will when a bedroom is added to a house. In this exercise, you'll add living_area back as an explanatory variable, and be explicit in evaluating the model by defining what we mean by "add a bedroom".

For the purposes of the exercise, you'll take "add a bedroom" to mean adding 140 square feet to the living area. (For instance, as when renovating the attic to turn it into a bedroom.)

Instructions
100 XP
  • Run the code given to you to train price_model that includes living_area as a covariate.
  • Evaluate the model at a baseline scenario: a living_area of 2000 sq. feet, 2 bedrooms, and 1 bathroom, specified by the bathrooms variable. As for the other explanatory variables, you can pick any level you like or just let evaluate_model() choose a set of levels for you.
  • Evaluate the model again, but with living_area at 2140 and 3 bedrooms. Leave bathroom at 1.
  • Looking at the outputs of your evaluate_model() calls, find the difference in prices to see the effect of adding 140 sq. feet of living space and another bedroom. Remember, you want to isolate the effects of the living_area and bedrooms variables, so all other variables should be equivalent when making your comparison.
  • Run a third scenario by adding to the baseline scenario 165 sq. feet to living area, a third bedroom, and another half bathroom. (165 is 140 sq feet for the bedroom itself plus another 25 for the half-bath.)
  • How does this better-equipped new bedroom change the model price? Calculate the price difference between the third scenario and the baseline scenario.