**2. Materials and methods**

#### **2.1 Data collection**

To be able to assess the recent trends in the crop yield, fertiliser and water withdrawal nexus, historical data on the key variables (crop yield, agricultural water withdrawal, nitrogen, phosphate and potash) were collected. The methodological steps employed in this study are presented in **Figure 1**. The collected time series data were selected for the period 1990–2020 for which data were available. For the years 2012– 2022, the missing data were obtained by linear interpolation (see Section 2.3 below). Less than an insignificant 10% of the data were missing. Yield data were collected on maize, barley, sorghum and wheat (hectograms per hectare per year (hg/ha/year)) and were collected from FAOSTAT (FAO's agricultural database) [25]. The historical data on fertilisers for nitrogen, phosphate and potash (tons/year) were also collected from FAOSTAT (FAO's fertiliser statistics) [25]. The fertiliser data presented here represent fertiliser data used in agriculture in Morocco and reported by the government of Morocco to the FAO). Agricultural water withdrawal data were downloaded from AQUASTAT (FAO's irrigation and water withdrawal database) [26]. The data from FAOSTAT and AQUASTAT are observed data that are collected from individual countries and reported by the FAO. In cases of missing data, the FAO estimates the missing data but, in most cases, the data are observed records. Agricultural water withdrawal is used here as a proxy for irrigation. It includes surface water, ground water and non-conventional water that has been used for agriculture. The agricultural water withdrawal data are often reported by governments to the FAO.

**Figure 1.** *Methodological steps employed.*

#### **2.2 Data analysis**

The time series historical data were collected for the period 1990–2020. However, except for agricultural water withdrawal that had complete data from 1961 to 2020, all the other variables (fertilisers and yields) covered the data from 1990 to 2020. Therefore, the analysis was performed with the data that spanned the period 1990–2020. The data were analysed using the Statistical Package for the Social Sciences (SPSS) software while the graphs were produced using excel software. The inferential statistics used included simple linear regression, multiple linear regression, coefficient of determination (R2 ), p-values (significant at (p ≤ 0.05), t-values, linear interpolation and the related standard errors.

#### **2.3 Linear interpolation**

For homogeneity, the linear interpolation approach was used to estimate the missing data for yield and fertilisers for the period 2021–2022. The linear interpolation procedure used is defined below (Eq. (1)). The linear interpolation method is often used to estimate the unknown values or missing data through the known values or available data.

$$\mathbf{Y}\mathbf{y}\mathbf{r}\mathbf{n}\mathbf{r} = \mathbf{y}\mathbf{1} + ((\mathbf{x} - \mathbf{x1})/(\mathbf{x2} - \mathbf{x1}))^\*(\mathbf{y2} - \mathbf{y1})\tag{1}$$

where Yyrnr represents the unknown values or missing data for maize, barley, sorghum and wheat yield as well as missing values for nitrogen, phosphate and potash fertilisers, x represents the known values for maize, barley, sorghum and wheat yields as well as missing values for nitrogen, phosphate and potash fertilisers, x1 and y1 are the coordinates that are below the known x value and x2 and y2 are the coordinates that are above the known x value.

Once linear interpolation was finalised, a complete dataset for maize, barley, sorghum and wheat yields as well as missing values for nitrogen, phosphate and potash fertilisers were obtained covering the period 1990–2022.

#### **2.4 Multiple linear regression**

To assess the relationship between yield, agricultural water withdrawal and fertilisers, multiple linear regression was used to identify which independent variable impacts yield the most. Two regressions were fitted for each crop (Eqs. (2)–(9)), one based on the relationship between yield and nitrogen, phosphate and potash and one based on the relationship between yield, fertilisers and agricultural water withdrawal. This procedure was repeated for each crop as follows:

*2.4.1 Maize*

$$\text{Ymaize\\_yf} = \mathbf{a} + \mathbf{bX1} + \mathbf{bX2} + \mathbf{bX3} + \mathbf{\in} \tag{2}$$

where X1, X2, X3 (for nitrogen, phosphate and potash, respectively) are the explanatory variables and Ymaize\_yf is the dependent variable (maize yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

$$\mathbf{Y}\text{maize\\_ywf} = \mathbf{a} + \mathbf{b}\mathbf{X1} + \mathbf{b}\mathbf{X2} + \mathbf{\in}\tag{3}$$

where X1, X2 (agricultural water withdrawal and fertilisers, respectively) are the explanatory variables and Ymaize\_ywf is the dependent variable. The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

*2.4.2 Barley*

$$\mathbf{Y} \text{barley\\_yf} = \mathbf{a} + \mathbf{b} \mathbf{X1} + \mathbf{b} \mathbf{X2} + \mathbf{b} \mathbf{X3} + \mathbf{\in} \tag{4}$$

where X1, X2, X3 (nitrogen, phosphate and potash, respectively) are the explanatory variables and Ybarley\_yf is the dependent variable (barley yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

$$\mathbf{Y}\mathbf{b}\mathbf{a}\mathbf{e}\mathbf{e}\mathbf{y}\mathbf{y}\mathbf{w}\mathbf{f} = \mathbf{a} + \mathbf{b}\mathbf{X}\mathbf{1} + \mathbf{b}\mathbf{X}\mathbf{1} + \mathbf{e} \tag{5}$$

where X1, X2 (agricultural water withdrawal and fertilisers, respectively) are the explanatory variables and Ybarley\_ywf is the dependent variable (barley yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

*2.4.3 Sorghum*

$$\text{Ysorghum\\_yf} = \mathbf{a} + \mathbf{bX1} + \mathbf{bX2} + \mathbf{bX3} + \mathbf{\in} \tag{6}$$

where X1, X2, X3 (nitrogen, phosphate and potash, respectively) are the explanatory variables and Ysorghum\_yf is the dependent variable (sorghum yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

$$\text{Yorsghum\\_ywf} = \mathbf{a} + \mathbf{bX1} + \mathbf{bX2} + \mathbf{\in} \tag{7}$$

where X1, X2 (agricultural water withdrawal and fertilisers, respectively) are the explanatory variables and Ysorghum\_ywf is the dependent variable (sorghum yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

*2.4.4 Wheat*

$$\mathbf{\color{red}{Y}wheat\\_yf = a + bX1 + bX2 + bX3 + \in} \tag{8}$$

where X1, X2, X2 (nitrogen, phosphate and potash, respectively) are the explanatory variables and Ywheat\_yf is the dependent variable (wheat yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

$$\text{Ywheel\\_ywf} = \mathbf{a} + \mathbf{bX1} + \mathbf{bX2} + \mathbf{\in} \tag{9}$$

where X1, X2 (agricultural water withdrawal and fertilisers, respectively) are the explanatory variables and Ywheat\_ywf is the dependent variable (wheat yield). The slope of the line is b, and a is the intercept (the value of y when x = 0) and ∈ is the error term.

#### **3. Results**

#### **3.1 Fertiliser use in Moroccan agriculture**

In terms of the use of nitrogen, phosphate and potash fertilisers in African agriculture, Morocco is among the highest users as can be seen in **Figure 2**. For example, in the context of nitrogen fertilisers used in agriculture, Morocco records about 1,155332.34 tons together with other Africa countries like Egypt, Nigeria, Ethiopia and South Africa (**Figure 2a**). In terms of phosphate fertiliser usage in agriculture, Morocco still ranks among the top users in Africa. The country records about 410,513.54 tons together with countries like Algeria, Egypt, Nigeria, Ethiopia, Kenya and South Africa (**Figure 2b**). In the context of potash, Morocco still ranks among the highest users in Africa, using about 355,225.81 tons in its agriculture together with other leading countries such as Egypt, Nigeria and South Africa (**Figure 2c**).

#### **3.2 The evolution of crop yields, fertilisers (nutrients) and agricultural water withdrawals in Morocco**

In the context of the four crops under consideration in this study (maize, barley, sorghum and wheat), the evolution over time is one that has been highly variable and fluctuating between 1990 and 2022 (**Figure 3a**). Despite this observation, wheat

*Recent Trends in the Yield-Nutrient-Water Nexus in Morocco DOI: http://dx.doi.org/10.5772/intechopen.112552*

#### **Figure 2.**

*Agricultural fertilisers (tons) used in Africa (1990–2020). (a) Nitrogen, (b) phosphate and (c) potash. Source: Developed by authors from FAOSTAT.*

records the highest yield during this period followed by barley, maize and sorghum (**Figure 3a**). In terms of fertilisers/nutrients used in agriculture in Morocco, the results are consistent with those reported in **Figure 2a, b** and **c**. For example, in Morocco, though also slightly variable as yields, fertilisers/nutrients are generally dominated by nitrogen fertilisers that record the highest values throughout the series; this is followed by phosphate and potash, respectively (**Figure 3b**). In terms of agricultural water withdrawal, the historical data show a slight decline between 1990 and 2022 (**Figure 3c**).

## **3.3 Scatter plots and linear regression outputs of the relationship between fertilisers/nutrients and maize yields in Morocco**

The scatter plots depict the linear relationship between maize yields as the dependent variable and fertilisers as the independent variable. In the context of nitrogen fertilisers used in maize cultivation, it can be observed that an R2 of 0.0014 (0.14%) is obtained. This implies that only 0.14% of changes in maize yield can be explained by changes in nitrogen fertiliser application (**Figure 4a**). In terms of phosphate fertilisers

#### **Figure 3.**

*Evolution of (a) yields, (b) fertilisers/nutrients and (c) water withdrawal for irrigation in Morocco.*

used in maize cultivation, it can be observed that an R2 of 0.07 (7%) is obtained. This implies that only 7% of changes in maize yield can be explained by changes in phosphate fertiliser application (**Figure 4b**). Considering potash fertilisers used in maize cultivation, it can be observed that an R2 of 0.041 (4.1%) is obtained. This implies that only 4% of changes in maize yield can be explained by changes in potash fertiliser application (**Figure 4c**). From these linear trends, it can be observed that the *Recent Trends in the Yield-Nutrient-Water Nexus in Morocco DOI: http://dx.doi.org/10.5772/intechopen.112552*

#### **Figure 4.**

*Scatter plots of maize yield against (a) nutrient nitrogen, (b) nutrient phosphate and (c) nutrient potash.*

changes in maize yields cannot be explained by changes in fertiliser application. However, phosphate fertilisers seem to outbid the other nutrients as they record relatively higher R2 of 7%. Phosphate fertilisers tend to explain more of the changes in maize yield as depicted by the R2 of 7%, a statistic that is relatively higher than those recorded for nitrogen and potash.

The results from the scatter plots (**Figure 4a, b** and **c**) are consistent with multiple linear regression outputs (**Table 1**). This is observed, as phosphate fertilisers tend to record the lowest p-value of 0.15 and the highest t-value of 1.44. This is followed by potash (p-value = 0.34, t-value = �0.95) and lastly nitrogen (p-value = 0.72, t-value- = �0.35). Even though nitrogen represents higher levels of application in Moroccan agriculture, when it comes to maize, phosphates tend to explain more of the changes in maize yield than the other fertilisers. When the linear relationship between maize yield as the dependent variable and agricultural water withdrawal and fertilisers as the independent variables is considered, it is observed that agricultural water withdrawal records the lower p-value (0.11) and the highest t-value (�1.63) (**Table 2**). In relative terms, agricultural water withdrawal tends to explain more of the changes in maize yield when compared to fertilisers.
