Get startedGet started for free

Comparing coefficients of determination

Recall that the coefficient of determination is a measure of how well the linear regression line fits the observed values. An important motivation for including several explanatory variables in a linear regression is that you can improve the fit compared to considering only a single explanatory variable.

Here you'll compare the coefficient of determination for the three Taiwan house price models, to see which gives the best result.

mdl_price_vs_conv, mdl_price_vs_age, and mdl_price_vs_both are available as fitted models.

This exercise is part of the course

Intermediate Regression with statsmodels in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Print the coeffs of determination for mdl_price_vs_conv
print("rsquared_conv: ", ____)
print("rsquared_adj_conv: ", ____)

# Print the coeffs of determination for mdl_price_vs_age
print("rsquared_age: ", ____)
print("rsquared_adj_age: ", ____)

# Print the coeffs of determination for mdl_price_vs_both
print("rsquared_both: ", ____)
print("rsquared_adj_both: ", ____)
Edit and Run Code