Develop a Classical Linear Regression Model with Python (III): Model Improvement

A convenient Python function to drop insignificant variables and solve multicollinearity and dummy variables trap

Dr. Shouke Wei
5 min readDec 9, 2022

Part I: Model Estimation

Part II: Model Diagnostics

Part III: Model Improvement

Part IV: Model Evaluation

In the previous article, we found the problems existing in the linear regression model, which can be generally summarized as insignificant predictor, multicollinearity and dummy variables trap. In this article, we see the process to solve these problems first, and then I will display how to use a function that I created to conveniently solve these problems. During the model process, there involves an iterative process of reevaluating the improved model until the final optimal model is obtained.

1. Stepwise Regression

Stepwise regression is a step-by-step iterative process of removing or adding independent variables in the final model through iteratively examining the statistical significance of each independent variable. There are two stepwise methods, namely forward stepwise and backward stepwise.

--

--

Dr. Shouke Wei

Professor and Scientist in data analysis and modelling, machine learnig, and computer vision. Support my writing: https://medium.com/@shouke.wei/membership