# A Proposal for a New Python Library Implementing Stepwise Procedure
## 3 Methodology  
The proposed library aims to apply the stepwise procedure to perform a regression analysis. This procedure makes it possible to select a subset of the independent variables that best explain the variability of a dependent variable, in such a way that all the independent variables selected are statistically significant at a pre-established confidence level. The technological approach used is the Python language, which we used to propose and implement the regression model, facilitating its integration into studies that involve the application of a specific regression model. Figure 1 illustrates the methodological workflow of the stepwise library to validate and select the statistically significant variables. After collecting the data, processing and structuring it using Extraction, Transform, and Load (ETL) techniques is essential. Defining the variables that we want to predict and the variables that explain that prediction is critical to building a supervised machine learning model. In addition, it is essential to perform an exploratory analysis of the variables using unsupervised modeling to complement the evaluation process. When we have one or more explanatory variables of a qualitative nature, it is necessary to transform them into dummy variables, creating \(n-1\) dummies, where \(n\) is the number of categories present in each explanatory variable. Next, we built a general regression model to evaluate the statistical importance of all the variables involved. Next, if there are variables that are not statistically significant, a diagnosis of multicollinearity should be performed using the VIF and Tolerance statistics. Then, the main contribution of this paper is implemented: the stepwise procedure based on the statistical significance of variables as a function of the Python programming language. Stepwise automatically excludes variables that are not statistically significant from the model. The variable selection process is automated, allowing the model to select independent variables without manual intervention. In situations with many independent variables available, the stepwise method can reduce the dimensionality of the model, avoiding overfitting problems and improving the model's generalization to new data. During this process, variables may be added and then removed, as their statistical significance can change in the presence of other variables, even if they were significant initially. The algorithm retains those variables that, together, are all statistically significant, providing the best fit with all relevant predictors [3]. This is crucial for maintaining the model's predictive capability [6]. It is essential that all considered variables are statistically representative to explain the behavior of the dependent variable \(y\) alongside the other \(X_{i}\) variables, thereby preventing the \(\beta\) parameters from being altered by the inclusion of a variable whose \(\beta\) is not statistically different from zero [3; 30]. It is important to note that the implemented package allows you to define the desired error term. If the \"error_type\" argument is omitted, by  
Figure 1: Methodological workflow. default the stepwise function considers conventional error terms. However, if we set \"error_type\" to \"robust\", the algorithm considers Huber-White standard errors. After stepwise, a partial model is composed. The next step is to verify the adherence of the residuals to normality, using the Shapiro-Francia test, also implemented in the'statstests.tests' package (v. 1.0.7) in Python and presented in this article. If there is no adherence of the residues to normality, the next analysis is the diagnosis of heteroscedasticity. If there is heteroscedasticity in the model, applying the Breusch-Pagan test, which may indicate the omission of a relevant variable in the model.