1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Regression with statsmodels in Python

Connected

Exercise

Different levels of interaction

Once you have three explanatory variables, the number of options for specifying interactions increases. You can specify no interactions. You can specify 2-way interactions, which gives you model coefficients for each pair of variables. The third option is to specify all the interactions, which means the three 2-way interactions and the interaction between all three explanatory variables.

As the number of explanatory variables increases further, the number of interaction possibilities rapidly increases.

taiwan_real_estate is available.

Instructions 1/3

undefined XP
  • 1
    • Fit a linear regression of house price versus n_convenience, sqrt_dist_to_mrt_m, and house_age_years. Don't include a global intercept, and don't include any interactions.
  • 2
    • Fit a linear regression of house price versus n_convenience, sqrt_dist_to_mrt_m, and house_age_years. Don't include a global intercept, but do include 2-way and 3-way interactions between the explanatory variables.
  • 3
    • Fit a linear regression of house price versus n_convenience, sqrt_dist_to_mrt_m, and house_age_years. Don't include a global intercept, but do include 2-way (not 3-way) interactions between the explanatory variables.