# Optimized Weighted Nearest Neighbours Matching Algorithm for Control Group Selection
## 6 Conclusions  
Observational studies are widely applied data analysis methods in life sciences, in which the quality of the results is mainly determined by the control group selection process. The more similar the selected control group and the case group are to each other, the more reliable the result of the analysis is.  
In this paper, an optimized \(k\)-nearest neighbours-based control group selection method, called Weighted Nearest Neighbours Control Group Selection with Simulated Annealing (WNNSA), was proposed. The WNNSA method applies simulated annealing to find the best pairing of treated individuals and candidates for selecting for the control group. The optimization is performed in the original feature space of the objects and not in the compressed space of the balancing scores, as the widely applied PSM method does. Furthermore, in contrast to the WNNEM method, optimization is performed on a global level.  
Figure 6: Results of Hansen and Bowers tests in Scenario II. Comparison of the \(p\)-values of the Hansen and Bowers test in case of the nearest neighbour matching (NNM), Mahalanobis metric matching (MMM), two types of PSM methods (PSM_02, PSM_DYN), the WNNEM method, and the WNNSA method for the 100 datasets in Scenario II.  
The efficiency of the WNNSA method was presented by Monte Carlo simulations. Simulation results confirmed that the WNNSA method could outperform the stratified matching-based control group selection method, the nearest neighbour matching, the Mahalanobis metric matching, the WNNEM method, and the widely applied greedy propensity score matching method in feature spaces where only a few covariates characterize individuals, and the covariates can only take a few values. In this restricted feature space, numerous conflicted situations may arise in the selection of similar individuals, which can be effectively handled by the proposed WNNSA algorithm.  
Conceptualization, S.S. and A.V.-F.; methodology, S.S. and A.V.-F.; software, S.S.; validation, S.S. and A.V.-F.; formal analysis, S.S. and A.V.-F.; investigation, S.S. and A.V.-F.; data curation, S.S. and A.V.-F.; writing--original draft preparation, S.S. and A.V.-F.; writing--review and editing, S.S. and A.V.-F.; visualization, S.S. and A.V.-F.; supervision, A.V.-F.; project administration, S.S. and A.V.-F.; funding acquisition, A.V.-F. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
Data Availability StatementData supporting reported results can be found at [[https://github.com/vathyfogarassy/WNNSA](https://github.com/vathyfogarassy/WNNSA)]([https://github.com/vathyfogarassy/WNNSA](https://github.com/vathyfogarassy/WNNSA)) (accessed on 30 October 2021).  
We acknowledge the professional support of GINOP-2.2.1-15-2016-00019 \"Development of intelligent, process-based decision support system for cardiologists\".  
The authors declare no conflict of interest.  
The following abbreviations are used in this manuscript:  
\begin{tabular}{l l} DDI & Distribution Dissimilarity Index \\ GDI & Global Dissimilarity Index \\ HB & Hansen and Bowers test \\ MMM & Mahalanobis metric matching \\ NN & Nearest neighbour \\ NNI & Nearest Neighbour Index \\ NNM & Nearest neighbour matching \\ OR & Odds ratio \\ PSM & Propensity Score Matching \\ SA & Simulated annealing \\ SM & Stratified matching \\ SMD & Standardized mean difference \\ WNNEM & Weighted Nearest Neighbours Control Group Selection with Error Minimization \\ WNNSA & Weighted Nearest Neighbours Control Group Selection with Simulated Annealing \\ \end{tabular}