# Optimized Weighted Nearest Neighbours Matching Algorithm for Control Group Selection
## 2 Related Work  
Control group selection aims to find such a group of individuals (\(X_{UT}\)), which is similar to the individuals in the treated group (\(X_{T}\)). The selection is generally performed by applying matching techniques so that proper individuals are selected from a set of possible candidates (\(X_{C}\)). Although 1:1 and 1:N matching can also be performed, mostly 1:1 matching is applied. Matching should be performed on those baseline covariates (\(f_{1},f_{2},\ldots,f_{n}\), \(n\in\mathbb{N}\)) that affect both the exposure of the group membership and the outcome variable of the study. As all individuals in \(X_{T}\), \(X_{C}\), and \(X_{UT}\) are characterized by \(n\) features, they can be seen as \(n\)-dimensional objects in the \(n\)-dimensional vector space. Since the treated and control groups must be disjoint, it is a basic expectation that \(X_{T}\cap X_{C}=\emptyset\). In clinical research, the control group is mainly selected by propensity score matching. In this case, the pairing of individuals is performed in the one-dimensional space of the propensity scores. Propensity score (which is a balancing score) is the likelihood of the individuals being assigned to the treated group according to the baseline covariates, and it is usually calculated by a logistic regression fit [8; 9]. In order to balance the bias of the treated and control groups, PSM selects those individuals into the control group who have similar propensity scores to the individuals in the treated group. The matching can be performed in different ways. The most widely applied PSM methods are nearest neighbour matching, radius matching, and inverse probability weighting [10; 11; 12]. The application of PSM has been the subject of numerous research, for example, its application was studied for subgroup analysis [13] and also for handling missing data [14]. Although different methods may produce control groups of different quality [15] (depending on the nature of the population used for selection), studies published in the literature most often only use the greedy PSM matching. Despite the popularity of the widely applied greedy \(k\)-nn-based PSM method, it has also got many criticisms [16; 17; 18; 19; 20; 21; 22]. All these articles pointed out that the PSM method in some cases and studies may result in a not well-balanced control group. For example, in [20] the authors highlighted that propensity score matching might increase imbalance even relative to the original data. The main limitation of the PSM methods is that they map the feature space into a single value (propensity score), and the matching of the individuals is performed in this compressed space. This can cause the problem of competing risks; this problem was also highlighted in [23]. However, the matching of the individuals can also be performed in the original feature space, and it is not necessary to compress the features into a single value. The simplest solution of this approach is stratified matching (SM) [24]. The condition for the successful application of stratified matching is that there should be enough candidates in each stratum to perform the pairing. The disadvantage of this method arises from the difficulty of handling continuous features. The WNNEM method [7] also performs the matching in the original feature space of the individuals, but it utilizes the well-known \(k\)-nn principle for this purpose. This method can be seen as a hybrid combination of the PSM method and the nearest neighbour matching, as matching is performed based on the nearest neighbours, but the distances per dimension are weighted according to the relevance of the covariates (dimensions) calculated from a logistic regression fit. It was presented that the WNNEM method can select more balanced control groups than the greedy PSM method, especially in cases when individuals are characterized by only a few covariates and covariates can take only a few values [7].