Prediction of As, Cd, Cr, Hg, Ni, and Se Concentrations in Organic Amendments Using Portable X-ray Fluorescence and Multivariate Modeling

Featured Application: Extended use of portable X-ray ﬂuorescence (XRF) instruments to analyze organic amendments (composts, sewage sludges, organic fertilizers) to assess compliance with quality standards. The analysis could be cheaply and quickly carried out. Abstract: Portable X-ray fluorescence (pXRF) has been a widely used technique in various applications. However, its use for the analysis of organic amendments (composts, sewage sludges, organic fertilizers) is scarce. In these matrices, concentrations of some elements are below their detection limit. The objective of this work was to find multiple linear regression equations that were able to predict the aqua-regia-soluble concentrations of the elements As, Cd, Cr, Hg, Ni, and Se using the pXRF readings of other measurable elements as predictor variables. For this, a set of 30 samples of organic amendments (composts, sewage sludges, and organic fertilizers) from the Manure and Refuse Sample Exchange Programme of the Wageningen Evaluating Programs for Analytical Laboratories (MARSEP-WEPAL) was used. Several amendment type-dependent single or multiple linear functions were found based on 1, 2, or 3 predictors. The predictor readings corresponded to the concentration of elements of geogenic (Fe, Si, Ti, Cl, Zr Al, Ca, S, Mn, and Ba), anthropogenic (Zn and Pb), and agricultural (P and K) origin. The regression coefficients of these functions were r = 0.90–0.99; therefore, they allowed for the quantitative determination of the target elements. These results will allow for fast and reliable analysis of organic amendments using pXRF that is valid for quality control in treatment plants.

Although pXRF analyzers are making significant improvements regarding the analysis of numerous types of samples, their applicability and reliability for organic amendments have been limited until now.

Field Portable X-ray Fluorescence (pXRF) Analysis
The analyzer Niton XL3t 950s GOLDD+ XRF (Thermo Scientific Inc., Billerica, MA, USA), with its laboratory stand, was used throughout the study. More detailed information about the analyzer can be found on the manufacturer's website [25]. This analyzer was equipped with an X-ray tube with an Ag anode, operated at 50 keV, 200 µA, and 2 W, with a geometrically optimized large Si drift detector (GOLDD). The analyzer can measure elements from Mg to U. Detailed information on the fundamentals of the technique can be found in References [5,6]. The analyzer can operate in two factory calibration modes called mining (m) mode and soils (s) mode. Hereafter, the letters (m) and (s) are used after the chemical symbol of each element to indicate the measurement mode in which the readings were recorded. The mining mode is a fundamental parameter calibration and it is recommended for high concentrations and quantification [5]. In the mining mode, readings were obtained for the following elements (the number of samples of the Manure and Refuse Sample Exchange Programme (MARSEP) with results above the limit of detection (LOD) are in parenthesis): Mo (11), Zr (29), Sr (30), Rb (30), Pb (22), As (10), Zn (30), Cu (26), Fe (30), Mn (20), Cr (24), V (22), Ti (29), Ca (30), K (29), S (30), Ba (22), Sn (11), Ag (9), Bal (30), Nb (11), Al (22), P (30), Si (30), Cl (29), Mg (9). The mining method gives a parameter called Bal (30), which is the difference from 100% of the sum of all measured elements. This parameter is likely related to the organic matter content of the amendment. The elements U (0), Th (0), Au (0), Se (0), Ni (0), Co (1), W (0), Sb (0), Cd (4), Pd (1), and Bi (1) were also measured, although few readings were obtained since they were below the LODs, and consequently, these were not included in the following statistical procedures. The mining mode is recommended for element concentrations greater than 10 g kg −1 .
Dried and finely ground samples were measured by filling an XRF container (model SC-4331, 26 mm internal diameter, 24 mm height, Premier Lab Supply Inc., Port St. Lucie, FL, USA) capped with a 4 µm propylene film (model 240255, 63 mm diameter, Premier Lab Supply Inc., Port St. Lucie, FL, USA). The container was placed in the window of the laboratory stand, the analyzer was attached to this stand, each sample was scanned in triplicate in each of the mining and soil modes, and the average elemental readings for each mode were used thereafter. The analysis time for each scan was 90 s for the soil mode and 120 s for the mining mode.

Samples
The training set of samples consisted of organic amendments (composts, sewage sludges, and organic fertilizers) provided by the MARSEP program, which is part of the Wageningen Evaluating Programmes for Analytical Laboratories (WEPAL) [26]. Samples corresponding to the 1 and 3 quarterly periods of 2011 to 2019 (30 different samples) were included. The samples were of the following types: compost (14 samples), sewage sludge (11), and organic fertilizer (5). The samples came from different countries: Belgium (5), Netherlands (3), Switzerland (18), Philippines (1), and the United Kingdom (2). Samples were dried and finely crushed powders. These dry test samples have been shown to be stable over a number of years when stored at room temperature. The descriptive statistics (mean, minimum, and maximum values) for the aqua-regia-extractable contents of the selected elements in the three types of organic amendments are shown in Table 1.
The reference material SdAR-M2, which corresponded to a metal-rich sediment produced by the US Geological Survey [27], was used to assess the accuracy and stability of the pXRF instrument. For the verification check to be acceptable, it was considered that the measured value for each target analyte in these samples should be within ±20% relative difference (RD) of the true value [28]. The results for the readings taken seven times during the course of the work are shown in Table 2. As indicated by the RD values, the precision was very good for Pb(s), Ca(m), and Fe(m), and good for the rest of the elements considered, except for Ti(s) and Al(m), which were estimated by default, and S(s) and P(m), which were estimated in excess. The difference between the maximum and minimum values (range) showed great stability of the instrument during the study for Cu(s), Mn(s), Pb(s), Zn(s), Zr(s), Ca(s), Fe(m), and Si(m). The readings of K(s), Ti(s), Al(m), and P(m) varied by more than 10% with a maximum range of 20% for S(s).

Statistical Data Analysis
Discriminant analysis was carried out to build a predictive model for group membership by considering the type of amendment (compost, sewage sludge, and organic fertilizer) as the grouping variable. The model was composed of a discriminant function (or, for more than two groups, a set of discriminant functions) based on linear combinations of the predictor variables that provided the best discrimination between the groups.
For each amendment type, multiple linear regression analysis was used to predict the aqua-regiaextractable contents of the target elements (As, Cd, Cr, Hg, Ni, and Se) reported by the MARSEP program (dependent variable was called X(ae), where X is the chemical element) from independent (input) variables, which were the soil (Y(s)) or mining (Y(m)) readings of the pXRF instrument (corresponding to Y elements for which readings above the LOD were obtained). The first adjustment consisted of a single linear regression equation using an element for which a higher Pearson coefficient was obtained for the X(ae)-Y(s or m) relationship. After this first adjustment, the residuals were calculated and their correlations with other elemental readings were determined. The parameters with a higher and significant Pearson coefficient were then added one by one into the equation, and the process was repeated to look for additional significant independent variables. The new variables introduced did not present a correlation with those previously introduced to avoid collinearity. The calibration obtained in this way was considered quantitatively acceptable for a specific analyte if the correlation coefficient was greater than r = 0.98 [28]. The regression equations were calculated without the transformation of the data. The studentized deleted residuals from the compost and sewage sludge equations were obtained and plotted. These residuals referred to cases that would have large residuals if the model was estimated without the respective cases. These were cases that were not well accounted for by the independent variables.
The predicted values, X(predicted), obtained from the regression equations for the three types of amendments were then combined into one set of data and then compared with the real values, X(ae), by considering the whole set as confirmatory data. Since the confirmatory data sets expanded by more than an order of magnitude, the data were log-transformed for the comparison using a paired samples t-test and a 95% confidence probability in accordance with themethod of the Environmental Protection Agency of the United States (EPA) [28]. A few negative predicted concentrations were discarded for the t-test. The determination coefficient (R 2 ) of the least-squares linear regression analysis between the predicted and reported X(ae) values was used to check the performance of the adjustments obtained.
The EPA method for soils [28] indicated that the R 2 coefficient should be 0.5 or greater for the pXRF data to be considered screening level data. If the R 2 is 0.8 or higher, the data could potentially meet definitive level data criteria.
The relative difference (RD), that is the difference as a percentage between the predicted and actual values, was calculated for the individual results of each sample.
All statistical analyses were carried out with IBM© SPSS© Statistics version 25 (SPSS, Chicago, IL, USA).

Discriminant Analysis
The result of the discriminant analysis is shown in Figure 1. Discriminant function 1, which explained 74% of the variance, separated the amendment types, but types compost and sewage sludge were close along this axis. The standardized coefficients (data not shown) for this function indicated that the readings of Zn(s), Ca(m), Si(m), Bal(m) (i.e., organic matter content), and −Zr(s) were responsible for the discriminant effect. Discriminant function 2, which explained 26% of the variance, mainly separated the amendment types compost and sewage sludge. The standardized coefficients for this function indicated a greater discriminant ability for Bal(m), Ca(m), P(m), and Si(m). The predicted group membership from the discriminant analysis coincided at 97% with the actual membership of each amendment type; therefore, for the purposes of calculating multiple linear regressions between the parameters that follow, these were performed separately for each of the types compost, sewage sludge, and organic fertilizer.
were responsible for the discriminant effect. Discriminant function 2, which explained 26% of the variance, mainly separated the amendment types compost and sewage sludge. The standardized coefficients for this function indicated a greater discriminant ability for Bal(m), Ca(m), P(m), and Si(m). The predicted group membership from the discriminant analysis coincided at 97% with the actual membership of each amendment type; therefore, for the purposes of calculating multiple linear regressions between the parameters that follow, these were performed separately for each of the types compost, sewage sludge, and organic fertilizer.

Linear Relationships in Compost Samples
The multiple linear equations obtained for the target elements in compost-type samples are: Their statistics are shown in Table 3. The correlation coefficients of aqua-regia-soluble elemental concentrations, X(ae), and the pXRF readings are shown as supplementary material (Table S1). The Si(m) reading was used for the first linear adjustment factor of As(ae) (Equations (1) and (2)); the Zn(s) was used for modelling Cd(ae) (Equations (3) and (4)), Hg(ae) (Equations (6) and (7)), and Se(ae) (Equation (9)); and the Fe(m) was used for Cr(ae) (Equation (5)) and Ni(ae) (Equation (8)). These predictors showed the highest correlation coefficient (Table S1) and valid readings were obtained for all compost samples (N = 14). In the case of As, after the first linear adjustment, the residuals were successively correlated with the Zr(s) and Pb(s) readings, which were then introduced by obtaining the Equations (1) and (2). The best fit (r = 0.980, Table 3) was obtained with Equation (2), and hence it was used for the prediction of As, but only in n = 13 out of the 14 compost samples due to the lack of a Pb(s) datum in one of the samples. For the remaining sample, Equation (1) was used. It should be noted that the additional terms that are introduced into the equations did not necessarily correlate initially with the target element; in the case of As, Pb(s) did not show an initial correlation with As(ae) (Table S1), although its coefficient in Equation (2) was statistically significant (p = 0.029, Table 3).
In the case of Cd, good fittings were obtained with Zn(s) and Zr(s) (Equation (3), used for n = 1 sample, r = 0.989) and Mn(s) (Equation (4) for n = 13 samples, r = 0.996). In the case of Cr, the best fitting was obtained with Fe(m), K(s), and S(s) (Equation (5), r = 0.975). Despite the fact that the Cr(s) readings could be obtained in 10 compost samples, the correlation with Cr(ae) of these readings (r = 0.764) was of lesser magnitude than the fitting obtained from Equation (5) (r = 0.975). In the case of Hg, a mediocre fitting (r = 0.949) was obtained with Zn(s) (Equation (6)), but it was improved (r = 0.995) by including Mn(s) and S(s) (Equation (7)). Ni was modelled with Fe(m) and Bal(m) (Equation (8), r = 0.977)). Selenium was modelled with Zn(s) and Zr(s) (Equation (9), r = 0.981). The elements Cd and Se were modeled with the same predictors Zn(s) and Zr(s) in Equations (3) and (9), which agreed with the significant correlation observed between Cd(ae) and Se(ae) in the compost samples (r = 0.918, n = 14). All the terms included in the fitting equations were statistically significant (p-values < 0.05). In general, the equations for compost can be considered quantitatively acceptable for calibration (r > 0.98) [28].
The studentized deleted residuals for several compost equations are shown in Figure 2. No outliers were observed in these plots, except one Cd datum. Furthermore, the absence of a pattern in the distribution of residues in the plots corresponding to compost in Figure 2 indicates that there was likely no significant bias affecting the equations. Table 3. Statistics of linear equations for the prediction of aqua-regia-extractable contents of trace metals (X(pred)) from the readings (soil and mining methods) obtained using pXRF on the compost samples.

Linear Relationships in Sewage Sludge Samples
The multiple linear equations obtained for the target elements in the sewage sludge samples are: Their statistics are shown in Table 4. The correlation coefficients of the aqua-regia-soluble elemental concentrations, X(ae), and the pXRF readings are shown as supplementary material (Table S2). The Pb(s) readings showed a high correlation with As(ae) and Hg(ae), and thus it was used as the first factor for the calculation of the linear equations of these elements (Equation (10), for As and Equations (15) and (16) for Hg). Successive improvements in the Hg equations were obtained when including the K(s) and Al(m) readings. Zn(s) showed the highest correlation coefficient with Cd(ae) and it was used for modeling Cd (Equation (12)). An additional Pb(s) term was also used in the Equation (12). The readings Cl(m) correlated with Cr(ae) in all 11 sewage sludge samples (Table S2) and was used in Equation (14) with a second significant Ti(s) coefficient. Ti(s) was also correlated with Ni(ae) (Equation (17)) but the Al(m) coefficient was better in nine sewage sludge samples and Equation (18) was also obtained for Ni. The Fe(m) readings further improved Equation (17). The P(m) readings showed a correlation with Se(ae) and Equations (19) and (20) used P(m). The second coefficients in these equations were Fe(m) and Ba(s). In a certain number of samples, significant and high correlations were observed for the As(s) and Cr(s) readings with the corresponding values of As(ae) and Cr(ae) such that direct relationships were fitted between these parameters (Equations (11) and (13)) when the corresponding pXRF readings were above the LOD. All the element coefficients included in the fitting equations were statistically significant (p-values < 0.05). In general, the equations for sludge cannot be considered quantitatively acceptable for calibration (r < 0.98) [28]. The studentized deleted residuals for several sewage sludge equations are shown in Figure 2. No outliers were observed in these plots except one Cr (no. 15) and one Ni data. Furthermore, the absence of a pattern in the distribution of residuals in the corresponding plots in Figure 2 indicates that there was likely no significant bias affecting the equations. Table 4. Statistics of linear equations for the prediction of aqua-regia-extractable contents of trace metals (X(pred)) from the readings (soil and mining methods) obtained using pXRF on the sewage sludge samples.

Linear Relationships in Organic Fertiliser Samples
The multiple linear equations obtained for the target elements in organic fertilizers are: Their statistics are shown in Table 5. Correlation coefficients of aqua-regia-soluble elemental concentrations, X(ae), and the pXRF readings for the organic fertilizers are shown as supplementary material (Table S3). For the organic fertilizers, the best correlation of As(ae) was with Zr(s) in four out of the five samples and it was used in Equation (22). Fe(m) also resulted in a mediocre correlation and was used in Equation (21) for the prediction of the remaining sample. Equations (21) and (22) could not be improved with additional terms. Cd(ae) correlated with Si(m) and their relationship corresponded to Equation (23). There was no correlation of Cr(ae) with any of the elements read using pXRF. Hence, Equation (13) obtained for sewage sludge samples was used for one organic fertilizer sample for which the Cr(s) reading was above LOD. The RD for this calculated value was 17.5%. Hg(ae) correlated with Cl(m) and the corresponding formula was Equation (24), which included an additional Ca(m) term. Ni(ae) correlated with both Fe(m) in Equation (25) and Zr(s) in Equation (26) for four samples. Se(ae) was predicted using Fe(m) in Equation (27). The coefficients of the element terms were significant (p < 0.05) in all the adjustment equations. The equations used for most of the organic fertilizer samples can be considered quantitatively acceptable for calibration (r > 0.98) [28]. Table 5. Statistics of linear equations for the prediction of aqua-regia-extractable contents of trace metals (X(pred)) from the readings (soil and mining methods) obtained using pXRF on the organic fertilizers.  1 Values are in mg kg −1 except Hg(pred) and Se(pred) in µg kg −1 . Units of Fe(m) and Ca(m) are g kg −1 . 2 N: number of data points for the adjustment; n: number of data used in Figure 1. 3 Equation (13) for sewage sludge samples was used for one organic fertilizer sample.

Combined Relationships for All Sample Types
The predicted values for each element, X(pred), obtained for the three amendment types with the equations in Tables 3-5 are plotted in Figure 3 (in log scale) against each corresponding "true" aqua regia concentration, X(ae). The R 2 coefficients are shown on each plot. The linear equations (data not shown) presented a very small value for the 0 intersections and the slopes were very close to 1. This can be seen by the proximity of points to the 1:1 line that is represented in the plots. When all the data were considered, the values of R 2 ranged between 0.83 in the case of As to 0.98 in the case of Hg. Figure 4 shows the RD values for all the samples. In general, the RD values were lower than 20%, except for a few samples with lower concentrations of the elements of concern. The number of samples for which RD was greater than 20% was: 7 for As, 6 for Cd, 7 for Cr, 11 for Ni, 9 for Hg, and 7 for Se. The number of samples for which RD was greater than 50% was: 5 for As, 1 for Cd, 1 for Cr, 4 for Ni, 3 for Hg, and 2 for Se.
When some of the samples with low concentrations (As < 2.8 mg kg −1 , Cd < 0.21 mg kg −1 , Cr < 58 mg kg −1 , Se < 280 µg kg −1 ) were discarded, the R 2 values improved and were higher than 0.91 in all cases (Figure 3).  The second most included element in the equations was Zr(m). It influenced As, Cd, and Se in compost and As and Ni in organic fertilizers. Zirconium occurs in several complex silicates that are frequently associated with Ti and Hf minerals. It does not accumulate in plants (levels in food plants vary from 0.005 to 2.6 mg kg −1 ), but the crustal abundance of Zr varies from 100 to 200 mg kg −1 [29].  The Si(m) readings are included for As in the compost equations and for Cd in the organic fertilizer equations. Arsenic is abundant in argillaceous sediments [29]; hence, its influence is likely related to the presence of soil clay particles in the amendments.
The readings of Ti(s) are included in Cr and Ni equations for sludges. As indicated before, Ti is also indicative of the presence of soil particles because it is an abundant element in the Earth's crust. Tella et al. [23] defined the Cr-Ni grouping as being of geogenic origin. Nevertheless, as Ti is used in many industrial applications, it cannot be ruled out that the Ti-Cr-Ni relationship in sludge may have another cause. Sager [22] indicated that in Austrian composts, a factor including Ni-Cr might have a common source, namely, the abrasion of tools. The Cr and Ni elements could also come from plastic films, textiles, footwear, paper, cardboard, glass, and packaging waste that can appear in municipal solid waste [32].
The elements Zn and Pb showed wide representation as they are the main predictors of As, Cd, Hg, and Se in compost, and for As, Cd, and Hg in sludge. All these elements (Zn, Pb, As, Cd, Hg, and

The Meaning of the Equations
In general, the fitting equations obtained (Tables 3-5) required few elementary terms (11 equations with one element term, 11 equations with two terms, and 5 equations with three terms) to obtain satisfactory approximations for the target elements (average r = 0.959 for all the equations).
The element most involved the most times in the equations in Tables 3-5 was Fe(m). It was present as the most important term in the fitting equations for Cr and Ni in compost, as a negative secondary term for Ni and Se in sludges, and as the most important term for As, Ni, and Se in organic fertilizers. Oxides and hydroxides of Fe and Mn are relatively common constituents in soils and they are closely related to trace metal behavior [29,30]. Tella et al. [23] observed a Cr-Ni-Fe relationship of geogenic origin when studying 17 compost samples of varied sources using PCA. Thus, the significant influence of Fe could be due to the variable proportion of soil mineral particles in the different samples, which would greatly affect the concentrations of the target trace elements.
The second most included element in the equations was Zr(m). It influenced As, Cd, and Se in compost and As and Ni in organic fertilizers. Zirconium occurs in several complex silicates that are frequently associated with Ti and Hf minerals. It does not accumulate in plants (levels in food plants vary from 0.005 to 2.6 mg kg −1 ), but the crustal abundance of Zr varies from 100 to 200 mg kg −1 [29]. Therefore, this element is also an indicator of the contribution of soil or mineral material in each sample. Anjos et al. [31] also suggested that the presence of Zr (as well as Fe, Ca, Ti, Rb, Sr) in samples of organic compost suggests that the compost was mixed into the soil in the composting process. The relevance of Fe and Zr is not only because they are a clue of the presence of soil in the samples, but it may also be related to their low LOD (see Anjos et al. [31] for LODs), allowing for good precision and time stability in their pXRF measurements (see Table 2).
The Si(m) readings are included for As in the compost equations and for Cd in the organic fertilizer equations. Arsenic is abundant in argillaceous sediments [29]; hence, its influence is likely related to the presence of soil clay particles in the amendments.
The readings of Ti(s) are included in Cr and Ni equations for sludges. As indicated before, Ti is also indicative of the presence of soil particles because it is an abundant element in the Earth's crust. Tella et al. [23] defined the Cr-Ni grouping as being of geogenic origin. Nevertheless, as Ti is used in many industrial applications, it cannot be ruled out that the Ti-Cr-Ni relationship in sludge may have another cause. Sager [22] indicated that in Austrian composts, a factor including Ni-Cr might have a common source, namely, the abrasion of tools. The Cr and Ni elements could also come from plastic films, textiles, footwear, paper, cardboard, glass, and packaging waste that can appear in municipal solid waste [32].
The elements Zn and Pb showed wide representation as they are the main predictors of As, Cd, Hg, and Se in compost, and for As, Cd, and Hg in sludge. All these elements (Zn, Pb, As, Cd, Hg, and Se) are commonly considered as being of anthropogenic origin [33] and generally accumulate in the fine size fractions [23]. The concentrations of Zn and Pb in the amendments (Table 1) were generally higher than their LOD for pXRF (<10 mg kg −1 [31]) such that these elements, when measured with good precision, can be considered good predictors.
Phosphorus appeared as a predictor of Se in sludge. In a study covering 68 rock phosphates and 162 P-containing fertilizers sold in Germany, Kratz et al. [34] found up to 12.1 mg kg −1 of Se. Kabata-Pendias and Pendias [29] indicated that there was up to 25 mg Se kg −1 in P fertilizers. Therefore, although P salts are usually used in wastewater treatment, the P-Se ratio may be indicative of an agricultural origin of both elements.
Predictive elements K, S, Ca, Cl, Al, Bal (i.e., organic matter), Mn, and Ba generally appeared as a second or third term in the equations. Therefore, they exercised a lower level of influence. These elements are major (K, S, Ca, Al) or common (Mn, Ba) constituents of the soil/plant system and phenomena, such as complexation, edaphic characteristics, redox conditions in the soil or during composting processes, and the treatment process of wastewater in the case of sludge, could be the causes of the relationships. For volatile elements, such as Hg and Se, atmospheric transport and deposition would also be involved. To explain their effects on the target elements, additional studies would be required.
After taking into account the small number of cases (5) used, the relationships found in the case of organic fertilizers should be taken with caution.
For compost and sludge, it should be noted that several equations included any of the elements of anthropogenic origin as the first predictor term (Equations (6), (10), and (12)), and in some other equations, any of the elements of edaphic or geogenic significance was added as a second term. (Equations (3), (4), (7), (9), (15), and (16)). Taking into account that the (standardized) coefficients of the first terms were always higher than those of the following terms, this indicates the importance of anthropogenic contamination in these matrices (compost and sewage sludge) and the common origin for a significant fraction of the elements included in these equations (Cd, Hg, Se, As, Zn, Pb). However, the crustal elements (Zr, Mn, S, K, Al) that represent the contribution of the edaphic or geological environment, although to a lesser extent, had a significant effect on the concentration of the objective elements (Cd, Hg, Se).

Confirmatory Analysis
For an empirical calibration to be acceptable, the regression equation for a specific analyte should have a correlation coefficient of r ≥ 0.98 [28]. Eleven out of the 27 equations given in Tables 3-5 met this requirement. Additionally, the proxies obtained ( Figure 3) for Cd, Ni, and Hg indicated that the predicted data were of high quality (definitive, R 2 > 0.9) while those for As, Cr, and Se can be considered to be screening-level data (R 2 > 0.5) according to the EPA criteria [28]. In Figures 2 and 3, it can be observed that the highest RD values were observed for the smallest concentrations of the target elements. For the reference samples, the EPA method [28] indicated that the measured value for each target analyte should be within ±20% RD of the true value to be acceptable. This value (20%) is considered as the limit of adequate precision of the individual results.
Discarding the data below the limits indicated in Figure 3 (As < 2.8 mg kg −1 , Cd < 0.21 mg kg −1 , Cr < 58 mg kg −1 , Se < 280 µg kg −1 ), the remaining predicted data reached the R 2 criteria of definitive (high-quality) data for all the elements. These cutoff limits have been selected approximately using visual observation of the plots in Figure 3. The limits could be considered as an approximation to the quantification limits (LOQ) of the adjustments used.
For the elements As, Cd, Ni, and Cr, most of the organic fertilizer samples were found among the discarded samples. The sample with high RD values was the one with the lowest concentrations of all the elements considered ( Figure 4). However, the predictions of Hg and Se values in organic fertilizers were satisfactory, despite the low number of samples of organic fertilizers used in the calibration and the low concentration of these elements in these samples. In the case of compost samples, in general, the predictions were good and only a higher magnitude RD was observed in Figure 4 for the two to three samples that presented the lowest concentrations of the target elements. In the sludge type, a significant RD (>50%) was found for the Ni and Hg predicted contents of several samples. The fit of the equations used for sludge (Table 4) can be improved and it may be necessary to have a larger number and more geographic diversity of samples for calibration such that additional terms may be included in the equations.
The limits established by European legislation [35] for these contaminants in a growing medium are 1.5 mg Cd kg −1 , 1000 µg Hg kg −1 , 50 mg Ni kg −1 , and 40 mg inorganic As kg −1 . As can be seen in Figure 2, these limits are included (for Cd, Hg, Ni) or are higher (for As) than the ranges in which these elements have been determined. Furthermore, the precision of the predictions (Figure 4) above the indicated values was, in general, satisfactory. Only a few samples of sewage sludge, a type for which much higher statutory limits apply [36], exceeded the RD limit of 20%. This means that the pXRF technique with the indicated proxies could be valid to test the compliance of these types of products, at least for quality control purposes in the field or the factory applications. Even an analyte with more than 20% RD may be used, as long as its linearity is satisfactory, as it could allow for properly ranking samples and detecting outliers [37].

Conclusions
This study highlights the potential of portable XRF analyzers for a fast, cheap, and reliable analysis of heavy metals and trace elements in organic amendments (composts, sewage sludges, and organic fertilizers), even if these elements cannot be directly determined by the analyzer due to them being below their limits of detection. Using a chemometric procedure based on multiple and simple linear equations, the elements As, Cd, Cr, Ni, Hg, and Se were predicted quantitatively. Predictive linear equations were created that included as the most important terms the readings obtained with pXRF for a few elements to which a different origin or source can be attributed. The elements Fe, Si, Ti, Cl, and Zr indicate a geological or pedogenetic origin; the elements Zn and Pb signify contamination of an anthropogenic origin; and the element P denotes an agricultural/anthropogenic influence. The readings of the elements Al, K, Ca, S, Mn, and Ba were also present in the equations as secondary factors. The degree of importance of each factor was dependent on the predicted target element as well as on the type of amendment (compost, sewage sludge, organic fertilizer) in question.
Considering that the correction factors only made use of the pXRF analyzer readings, and that the scans required a very short analysis time (3.5 min), the proposed analytical approach could be usable in field conditions without requiring other additional parameters that must be obtained in the laboratory.
Although the calibration equations obtained in this study were obtained with a well-characterized set of samples of compost, sewage sludge, and organic fertilizers from various European countries, their universal validity may be questionable. It could be possible that the factors found or their relative weights were different depending on the materials present in the amendments, the regional geological or edaphic characteristics, and the possible sources of anthropogenic contamination. It would be necessary to obtain specific calibrations for other types of amendments, for example, manure, and this would be possible as long as a homogeneous group could be separated. For samples of amendments of an unknown type, we understand that it would be feasible to first apply a process to classify the sample according to its analytical results (discriminant analysis or similar) and then apply the corresponding calibration. In addition, specific (locally or regionally adapted) and interlaboratory calibrations should be obtained to assess the generalization of the relationships found or to find those specifically adapted. However, although the results presented here show a high degree of consistency with basic knowledge about organic amendments, soil science, and potential sources of contaminants, a more detailed analysis of the statistical quality of the forecast equations is still needed. Specifically, subsequent calibration studies should be carried out that expand the number or types of sample to corroborate the results of this work, taking into account the compositional nature of the data [38]. The cross-checking of equipment from different brands and suppliers is also necessary. In any case, the proposed analytical approach would be very useful for quality control and regulatory compliance tasks in waste treatment facilities (composting plants, wastewater treatment plants) or the manufacturing of organic amendments, avoiding much more tedious routine analytical procedures. In these situations, we believe that the pXRF technique represents a valuable decision support tool aimed at proper environmental management.