# A Proposal for a New Python Library Implementing Stepwise Procedure
However, two caveats are necessary. First, the package only selects the variables, and it is necessary to adjust the model again after selecting them. Second, and more importantly, the package selects the variables based on some metric, such as \(R^{2}\), MSE, MAE, RMSE, AIC, and BIC, among others, and it does not consider the statistical significance of the variables. The stepwise procedure is applied to models with multiple independent variables (\(X\)), where the issue of multicollinearity arises. [24]. A variable may be removed during the stepwise process for several reasons: if its parameter is not statistically different from zero at a given significance level (i.e., the variable \(X_{i}\) is not significant on its own); or if multicollinearity is present, meaning there is a correlation between variables, making it unnecessary to include two variables when one may already explain the behavior of the other. From a predictive standpoint, in cases of multicollinearity, one of the independent variables \(X_{i}\) will be removed to avoid prediction issues caused by multicollinearity. In other words, if an independent variable whose beta is not statistically different from zero is not excluded, the model loses its predictive power [6]. This is because that \(\beta\) parameter, in the presence of other variables, ceteris paribus, does not contribute to the predictive composition, making the variable statistically insignificant in explaining the behavior of the dependent variable \(Y\) alongside other \(X_{i}\) variables. Including such a \(\beta\) parameter could alter the magnitude and potentially even the sign of the other beta parameters, without contributing meaningfully to the construction of a predictive model [6; 24; 25]. In this sense, it is important to provide an implementation alternative that uses the statistical significance of the variables as a criterion. According to [6], metrics such as the \(R^{2}\) adjustment coefficient do not inform researchers whether a given explanatory variable is statistically significant and whether it is the true cause of changes in the behavior of the dependent variable. Moreover, this metric does not allow for an assessment of potential omitted variable bias or whether the choice of the explanatory variables included in the proposed model was appropriate. Thus, regarding the application of stepwise selection, it is insufficient to consider only adjustment or accuracy metrics; it is essential to take into account the statistical significance of the explanatory variables when selecting which ones remain in the final model after stepwise selection, since a model built from sample data that includes statistically insignificant beta parameters is not considered a final model when the goal is prediction [6; 24; 26]. It is important to note that this approach is more commonly used in applied sciences, such as statistics, engineering, and economics, where there is a need to develop models that identify sample phenomena and align the estimated model with the real-world sample data. However, in some contexts, the focus on the statistical significance of beta parameters is less emphasized, such as in the study of deterministic phenomena [6]. Despite the wealth of features offered by libraries such as \"stats models\" and \"scikit-learn\", there was no specific function for the stepwise procedure based on the statistical significance of the variables in Python. This gap limits the efficiency and practicality of implementing this procedure in research projects and practical applications. The absence of a specific library not only complicates the adoption of the stepwise procedure but also makes it difficult to standardize and reproduce experiments, resulting in additional efforts for users who wish to adopt and explore the various methods of variable selection, which can be based on metrics or statistical significance. Filling this gap represents an opportunity to advance the development of specialized tools for automated variable selection.