[…] Find the k nearest neighbors to x0: In SAS, this is done efficiently by using a k-d tree algorithm, but you can also use direct methods to compute nearest neighbors. …