| This paper aimed to introduce the fundamental concepts, computational methods, two case studies, and the implementation of k-nearest neighbor (k-NN) discriminant analysis method 2 using SAS. The basic concepts included k value selection, distance metrics, majority voting rules, lazy learning, feature space, and normalization. The computational methods involved k value selection, distance calculation, sorting and selecting the k nearest neighbors, calculating category frequency, and determination of the majority voting rule. The datasets in the two case studies comprised "data on 66 Kangqiao water snakes" and "measurement results of six quantitative indicators from seven fish species." Using SAS software, k-nearest neighbor discriminant analysis was performed on the data from both case studies, and the SAS output results were interpreted. |