The selection of stable wavebands for the near-infrared (NIR) spectroscopic analysis of total nitrogen (TN) in soil was accomplished by using an improved moving window partial least squares (MWPLS) method. A new modeling approach was performed based on randomness, similarity and stability, which pro