| The purpose of this paper was to introduce the fundamental concepts, computational methods, two practical examples, and the implementation of? k-nearest neighbors (k-NN) discriminant analysis Method 1?using SAS software. The fundamental concepts?included k-NN discriminant analysis Method, determination of? k value?and identification of? k-nearest neighbors, distance metrics between samples, majority voting or weighted voting, and the core principles of the method. Computational methods?covered the formulas for three distance metrics, discriminant criteria, classification rules, and handling special cases. Two datasets?were analyzed: The first one was the measurements of?four quantitative traits?across?three Iris species, and the second one was the measurements of?four quantitative traits?across?five crop types. The SAS software was employed to perform k-NN discriminant analysis on both datasets, followed by detailed interpretation of the SAS output. |