## 3 Proposed Method  
### Goodness Function  
When conducting long-term studies, it is not always possible to develop a sample design that makes it possible to obtain optimal estimates of the effects in the ANOVA model, since it is difficult to ensure conditions under which a similar sample of persons would be observed every year. Often, as in our case, one must be content with passive observations. As shown by the exploratory analysis of the data, the available sample is very uneven in the distribution of observations for natural categories, namely, by 23 years of observation, 10 departments, and gender. That is, a very uneven number of observations fell into each data block. This circumstance leads to an unacceptable quality of the ANOVA model, due to the failure to fulfill the homoscedasticity condition (significant differences in the variances of individual data blocks). A natural solution to this problem can be data aggregation, that is, the transition from small categories to larger ones, in which the data will be more evenly distributed. Aggregation, on the one hand, builds an optimal statistical model, in the best possible way extracting information contained in real data. On the other hand, the unification of informationally similar groups of students from the intelligence structure point of view will allow for a better interpretation of the results and make reasoned conclusions. In our study, we will aggregate two explanatory variables year and department. In this case, the aggregation for the ordinal variable year will be carried out by discretization methods, considering possible mergers of only adjacent intervals. For the categorical department variable, we will consider all possible mergers using the grouping method. The gender factor should not be aggregated as it includes the minimum possible number of categories. The results of merging the levels of factors based on the application of discretization and grouping methods depend on the goodness criterion according to which the obtainedpartitions are compared with each other. Most often, the quality of a regression model is judged by the coefficient of determination, calculated as  
\[R^{2}=1-\frac{ESS}{TSS},\]  
where \(ESS\) is a residual sum of squares, \(TSS\) is a total sum of squares for the model. The choice of the determination coefficient as a goodness criterion does not give any results, since the original partition always provides a minimum residual sum of squares. Indeed, any merging of intervals leads to a decrease in \(R^{2}\). To test the significance of the model, the F-statistic is used, calculated as  
\[F=\frac{R^{2}}{1-R^{2}}\frac{N-p}{p-1},\]  
where \(N\) is the number of observations, \(p\) is the number of estimated parameters of the model. It takes degrees of freedom into account, so an increase in model complexity must be offset by a sufficient decrease in the residual sum of squares. When using the F-statistic, contrary to \(R^{2}\), any merging of intervals leads to an improvement of the goodness function. Thus, the work of the algorithm ended only when the intervals could no longer be merged, that is, using this criterion leaves the minimum possible number of categories. Thus, neither \(R^{2}\) nor F-statistic is suitable for solving the discretization and grouping problem, since they lead to limiting degenerate partitions. The authors of [55] studied two groups of goodness criteria, which were distinguished for solving the discretization problem, namely, information and statistical ones. Information criteria are intended to reduce the loss of information when merging separate categories into groups. They are intended to improve the quality of extracted knowledge. Statistical criteria try to solve simultaneously two opposite problems. On the one hand, these criteria pay attention to the accuracy of model prediction; on the other hand, they do not make it possible to build an overly complex model. This balances the accuracy and complexity of the model.