Comparing residual standard error
The other common metric for assessing model fit is the residual standard error (RSE), which measures the typical size of the residuals.
RSE can't directly be retrieved using statsmodels
, but you can retrieve the mean squared error (MSE) using the .mse_resid
attribute. By taking the square root of the MSE, you can get the RSE.
In the last exercise, you saw how including both explanatory variables into the model increased the coefficient of determination. How do you think using both explanatory variables will change the RSE?
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
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Print the RSE for mdl_price_vs_conv
print("rse_conv: ", ____)
# Print the RSE for mdl_price_vs_age
print("rse_age: ", ____)
# Print RSE for mdl_price_vs_both
print("rse_both: ", ____)