where CA is the component concentration determined by the reference method, C is the concentration found from the model and n is the number of samples. The RSEPcal and RSEPval errors were calculated for the calibration and validation data sets, respectively. The RSEPtest error for each chemical component was computed for the commercial milk samples. Cross-validation using the leave-4-out technique was performed to estimate the performance of the models, and the root-mean-square error of cross-validation (RMSECV) was calculated to select an optimal number of factors for the PLS models [21].