Introduction

The adverse effects of climatic variations on health, environment, agriculture, and livelihoods have become a global concern in the twenty-first century. The surge in the average temperature on the planet’s surface has been discovered by many researchers (Porter and Semenov 2005; Sommer et al. 2013; Attiaoui and Boufateh 2019). The average global temperature is forecasted to climb by 2.6–4.8 °C in the twenty-first century (IPCC 2013). More frequent disasters such as excessive rainfall, extreme weather events, a declining ice cover, and modifications to winter snow are some of the calamitous repercussions of climatic fluctuations that became recurrent threats to the environment (Mohamed et al. 2022; Warsame et al. 2022c). Agriculture production remains the most vulnerable sector to rainfall volatilities and a spike in average surface temperature (Gay et al. 2006; Deschenes and Kolstad. 2011; Van Passel et al. 2016). Consequently, agriculture yields plummeted due to climate change factors that undermined the global food security and sustainable livelihoods of low-income countries dependent on the agriculture sector (Warsame et al. 2022b; Zhao et al. 2017).

Climatic fluctuations are the most significant risk source that directly or indirectly influences crop production. According to Pickson et al. (2020), the rising temperature and changes in rainfall patterns have a straight impact on crop growth timing. Arable land becomes less appropriate for agricultural production as a result of surging temperature, which has long-run unfavourable eventuality on crop productivity. Moreover, variations in rainfall patterns are expected to result in both a short-run loss of crops and a long-run decline in crop production (Pickson et al. 2020). On the other hand, climatic fluctuations increase insects, weeds, and illnesses, which have an indirect adverse impact on agricultural yield since they make crop management difficult and costly. As a result, farmers face frequent floods, heavy rain, droughts, and fluctuations in market prices (Chandio et al. 2020). Besides these factors, the literature was controversial about the repercussions of rainfall and temperature changes on agricultural production across different regions. For instance, Chandio et al. (2020) confirmed that precipitation and temperature in China have a favourable impact on agrarian value added in the short-run but ruin in the long-run. In contrast, Pickson et al. (2020) noticed that average precipitation and the cropped land area had a significant and positive impact on cereal crop output in the short-run and long-run, whereas mean temperature and temperature variations in China have a considerable adverse effect on the long-run cereal production.

East Africa region is encountering an unprecedented increase in temperature. The major cities in this region have witnessed a temperature increase that is almost double the global average of 1.1 °C since the pre-industrial era. For instance, since 1860, Mogadishu (Somalia) has warmed by 1.9 °C, Khartoum (Sudan) by 2.09 °C, Addis Ababa (Ethiopia) by 2.2 °C, Nairobi (Kenya) by 1.9 °C, and Da res Salaam (Tanzania) by 1.9 °C (ICPAC 2021). Given the fact that climate change is strongly linked to the farming sector, rain-fed agriculture represents the primary means of livelihood in the East Africa region. Rural population livelihoods and food security in this region are becoming more exposed to the consequences of climatic variations (WWF 2006). Agriculture constitutes 40% of the gross domestic product (GDP) and offers livelihoods for 80% of the East African population. Temperature increases and rainfall variability have already affected the agriculture sector in this region (WWF 2006). Nevertheless, a deep understanding of climate change effects, vulnerabilities, and adaptation strategies is required to mitigate global warming and its consequences. Empirical research and initiatives to strengthen the capacity to generate climate data and disseminate have become topical. In this regard, this study empirically examines climate change factors—mean rainfall, temperature, and CO2 emissions—impacts on agricultural output in East African countries.

The agriculture sector is a key ingredient for sustainable economic growth and development in developing countries. Climate change poses a significant threat to the agriculture sector. Comprehensive empirical studies on the climate change-agriculture nexus have been carried out over the globe using various analysis methods. Most studies have concluded that climate change has significantly impacted the agricultural output of different regions and countries, although the magnitude of the effect varies with the kind of crops. Among studies outside Africa, Chandio et al. (2022a) ascertained the effect of climate change on maize output in Nepal. The short-run and long-run empirical findings of the study disclosed that rainfall stimulates maize production, whereas temperature and carbon emissions hamper it. Comparable results were found by Chandio et al. (2022b) in India, Sadiq et al. (2018) in Pakistan, and Chandio et al. (2022c) in Bangladesh. The growing global population, deforestation, and the utilization of fossil fuels are attributed to the elevated level of greenhouse gases (GHGs), which derives climate change and hampers agriculture production (Pickson et al. 2022). Indeed, climatic variations’ impact on agriculture varies depending on the crop production type. Sarker et al. (2012) found that maximum temperature has a significant adverse effect on Boro rice but has a considerable favourable impact on Aman and Aus rice. Minimum temperature undermines Aman rice but stimulates Boro rice production. However, precipitation has consistently favourable implications for rice production in Bangladesh. Similar results were found by Satari Yuzbashkandi and Khalilian (2019) in Iran. On the contrary, Abbas and Mayo (2020) uncovered that maximum temperature undermines rice production while rainfall stimulates it in Pakistan. Using the Ricardian model, Hossain et al. (2019) revealed that precipitation and temperature enhance the net crop income in Bangladesh. Thus, this proves that climate change’s imminent effects on agriculture are heterogeneous.

The existing empirical studies on climate change–agriculture nexus in Africa also revealed that agriculture production decreases due to climatic fluctuations. The adverse effects of climate change are more felt in developing countries, including Africa, which rely on agriculture for a significant portion of their economic activities than developed nations. Notably, Sub-Saharan African (SSA) countries are more exposed to climate variations than other nations due to their lack of climate adaptability and high dependence on agriculture (Sarkodie and Strezov 2019). Among early undertakings, Barrios et al. (2008) conducted a comparative study analyzing the consequences of climate change on agriculture output in SSA and non-SSA countries. They concluded that temperature and average rainfall have substantial negative and positive effects on agriculture production in SSA nations, respectively, whereas climate change is inconsequential in non-SSA countries. Later, Sultan et al. (2013) ascertained the influence of climate change on millet and sorghum output in West African countries. They revealed that rainfall and temperature changes hamper agriculture yield in West African nations. Likewise, Ben Zaied and Ben Cheikh (2015) revealed that mean temperature rise undermines cereal and date yields, except in upland areas, while rainfall enhances cereal and date productions in Tunisia. Alboghdady and El-Hendawy (2016) found that temperature and rainfall changes undermine agricultural yield in the Middle East and North Africa (MENA). In the same vein, Ngoma et al. (2021) have observed that temperature and rainfall variabilities have dreadful effects on agriculture production in Zambia. Recently, Warsame et al. (2021, 2022a) found that rainfall has a constructive role in enhancing agriculture production in Somalia, whereas average temperature impedes it in Somalia. Using dynamic ARDL simulation, Ntiamoah et al. (2022) estimated the effect of CO2 emissions and precipitation on maize and soybean production in Ghana. The outcomes of the study indicated that both CO2 emissions and rainfall have a constructive role in enhancing maize and soybean output in Ghana.

The intensity of climate change impacts on agriculture production differs due to the data discrepancy, income level, adaptation capacity, and prevailing climatic conditions. Due to their limited ability to adapt to climatic variations, excessive reliance on agriculture, and the majority of their populations living in rural areas, East African countries are the most vulnerable to climate change (Sarkodie and Strezov 2019). Nevertherless, cross-country studies about the region are limited in the existing literature. To guide the formation and carrying out of common climate change policies at the regional level, it is necessary to conduct a panel study because the findings of the existing individual country studies could not be generalized to large number of countries. Hence, the current study aims to assess the effect of climate change—measured for rainfall, temperature, and CO2 emissions—on cereal crop production in East Africa using panel data during the period 1990 and 2018. The study utilized pooled mean group (PMG) technique to reflect the dynamic long-run and short-run impacts of climatic variation on the output of cereal crops. The study employs several panel cointegration methods, such as DOLS and FMOLS, as a robustness test to validate the reliability of the panel ARDL results. Moreover, the study uses Dumitrescu and Hurlin (2012) panel causality test to determine the direction of the causal relationship between the explanatory variables and cereal crop production.

The subsequent sections of the study are organized as follows: the “Methodology” section presents the data and methodology of the study, empirical analysis and discussion will be presented in the “Empirical results and discussion” section, and finally, the conclusion and policy implications will be reported in the “Conclusion” section.

Methodology

Data description

The study utilized panel data covering the period 1990–2018 to examine the aftermath of climate change on the agricultural output of nine East African countries (Burundi, Djibouti, Eritrea, Ethiopia, Kenya, Rwanda, Somalia, Tanzania, and Uganda). Due to the consequences of global warming, the region has experienced horrendous repercussions of climate change on agricultural output since it relies hugely upon its livelihoods and employment. According to Nicholson (2017), the most common climatic scenario in East African counties is the frequent occurrence of acute droughts, mainly resulting from changes in rainfall patterns. Additionally, some of Africa’s flood-prone countries are located in the region (Li et al. 2016). Therefore, the study uses cereal crop production to measure agricultural output, which is influenced by climatic factors such as average rainfall, temperature, and carbon dioxide emissions (Warsame et al. 2021). To avoid model misspecification and variable omissions, we incorporate cultivated land area and rural population as crucial determinants of agricultural production (Chandio et al. 2020; Pickson et al. 2022). Table 1 demonstrates the variables, symbols, measurement units, and data sources.

Table 1 Variable illustration and data sources

Model specification

The cereal crop output function utilized in this study was specified by following Chandio et al. (2020), Warsame et al. (2021), Kumar et al. (2021), and Chandio et al. (2021). Regarding this, we employed the following panel model to investigate the effects of average rainfall, average temperature, carbon dioxide emissions, cultivated land area, and agriculture labor on cereal crop production in the selected countries.

$$\mathrm{CP}=f\left(\mathrm{ARF},\mathrm{ AT},\mathrm{ CO}2,\mathrm{ LUC},\mathrm{ RP}\right)$$
(1)

where CP denotes cereal crop production, which is the explained variable. The regressors include ARF, which indicates average rainfall, AT signifies temperature, CO2 represents carbon emissions, LUC denotes land under cereal output, and RP indicates the rural population. We converted all the inspected variables into a natural logarithm to ensure that the variables are interpreted as a percentage and reduce the heterogeneity issues frequently appearing in heterogeneous panel data. The reduced form is as follows:

$${lnCP}_{it}={\beta_0+\beta}_1{lnARF}_{it}+{\beta_2lnAT}_{it}+\beta_3{ln\mathrm{CO}}_{2_{it}}+\beta_4{lnLUC}_{it}+\beta_5{lnRP}_{it}+\varepsilon_{it}$$
(2)

Based on the panel dataset with groups of countries i = 1, 2, 3,..,N and periods t = 1, 2, 3,…,T. The ln signifies the natural logarithm, Ɛ signifies the white noise error term, and β0 is the intercept. β1, β4, and β5 are the coefficients of mean rainfall, land under cereal output, and rural population, which are expected to have a favourable influence on cereal crop production. However, β1 and β3 are the coefficients of average temperature and CO2 emissions, which are expected to have an unfavourable impact on agricultural output.

Econometric technique

Cross-sectional dependence test

There is a significant possibility of cross-sectional dependence (CD) among the countries in a panel data setting (Appiah et al. 2018). However, disregarding the CD test in the study might lead to invalid test statistics. Based on the test results, we can decide which econometric approach is appropriate for the panel data. Hence, this study investigates the dependency of the cross-sections in the sample using the Pesaran CD test proposed by Pesaran (2004). The Pesaran cross-sectional dependence test is preferred to other tests, including the Breusch-Pagan Lagrange Multiplier (LM) test, because it can account for common components or spillover effects that are not observed in the sample observations (Appiah et al. 2018). Besides, the null hypothesis of cross-sectional independence \({H}_{0 }: {\rho }_{ij }= {\rho }_{ji }=cor \left({e}_{it , }{e}_{jt}\right)=0, i\ne j\) is tested against the alternative hypothesis of cross-sectional dependence (\({H}_{1 }: {\rho }_{ij }= {\rho }_{ji }\ne 0, for some i\ne j)\); \({\rho }_{ji}\) denotes pair-wise disturbances’ correlation coefficient, which is calculated by following the specification of Simionescu et al. (2021).

$${\rho }_{ij }= {\rho }_{ji }=\frac{\sum_{t=1}^{T}{e}_{it}.{e}_{jt}}{\sqrt{\sum_{t=1}^{T}{{e}^{2}}_{it}.\sqrt{\sum_{t=1}^{T}{{e}^{2}}_{jt}}}}$$
(3)

The CD statistic of Pesaran could be computed as follows in the case of balanced panel data.

$$CD=\sqrt{\frac{2}{N\left(N-1\right)}}.\sum_{i=1}^{N-1}\sum_{j=1+1}^{N}{\widehat{\rho }}_{ij}$$
(4)

where T is the entire amount of observations shared between nations i and j.

$${\widehat{\rho }}_{ij}={\widehat{\rho }}_{ij}=\frac{{\Sigma }_{t}\in {T}_{i}\cap {T}_{j} \left({\widehat{e}}_{it }-{\overline{e} }_{i}\right)\left({\widehat{e}}_{jt }-{\overline{e} }_{j}\right)}{\sqrt{{{\Sigma }_{t}\in {T}_{i}\cap {T}_{j} \left({\widehat{e}}_{it }-{\overline{e} }_{i}\right)}^{2}} .\sqrt{{{\Sigma }_{t}\in {T}_{i}\cap {T}_{j} \left({\widehat{e}}_{jt }-{\overline{e} }_{j}\right)}^{2} }}$$
(5)
$${\overline{e} }_{i}=\frac{{\Sigma }_{t}\in {T}_{i}\cap {T}_{j} \left({\widehat{e}}_{it }\right)}{\#({T}_{i}\cap {T}_{j})}$$
(6)

Panel unit root tests

The stationarity test of the variables is a prerequisite prior to the panel cointegration test to determine the existence of a unit root and the order of integration. The first-generation panel unit root tests that presume cross-sectional independence could produce misleading results when there is cross-sectional dependence (Breitung and Das 2008). Due to the dependency of the individual panel units, Pesaran (2007) proposed the use of second-generation panel unit root tests, such as the cross-sectional ADF (CADF) and the cross-sectional augmented IPS (CIPS), to assure the validity and reliability of the results. These tests take into account the potential for cross-sectional dependency due to unknown common factors. The null hypothesis of the two tests assume that the entire panels are non-stationary against the alternative hypothesis that presume some panels are stationary. Hence, the null hypothesis is refuted if the probability values are less than 1%, 5%, and 10% significant levels. Unlike traditional panel cointegration methods, the panel ARDL has the capability to handle variables of various orders of integration.

Panel cointegration analysis

Before the central estimation of the panel ARDL model, it is also required to examine the existence of a cointegration relationship among the variables by applying Pedroni (1999, 2004) and Kao (1999). We have compared the alternative hypothesis, which indicates the presence of cointegration among the variables of interest, to the null hypothesis, which states that there is no cointegration between the climatic and non-climatic factors on the one hand and crop production in particular countries on the other. Therefore, the null hypothesis of no cointegration relationship would be rejected if the probability value is significant at 1%, 5%, and 10%, respectively.

Panel autoregressive distributed lag (ARDL) technique

The mean group (MG) and the pooled mean group (PMG) approaches developed by Pesaran (2004) and Pesaran et al. (1999) have been implemented to discover the long-run and short-run estimates of the study. Explicitly, the PMG estimator imposes equality of the long-run parameters across the entire country groups even though it permits the slope coefficients to vary between countries in the short-run. The PMG is a consistent and efficient estimator when there is a long-run homogeneity. However, the MG approach is more reliable when the slope and constants differ for individual country groups. Moreover, the PMG technique has the benefit of estimating the long-run and short-run parameters regardless of the series integrated at I(0), I(1), or both. Based on a comparison between the PMG and MG estimators, Hausman (1978) is employed to ascertain the null hypothesis of homogeneity constraint on the long-run coefficients.

The study implemented a panel ARDL approach to capture the effects of climatic variability on agricultural output in East African nations. In accordance with Pesaran et al. (1999), the panel ARDL framework of the study (p, q,q,q,q,q) is specified as follows:

$${\Delta lnCP}_{it}= {\alpha }_{0}+{\gamma }_{1}{lnCP}_{it-1}+ {\gamma }_{2}{lnARF}_{it-1}+ {\gamma }_{3}{lnAT}_{it-1}+ {\gamma }_{4}{ln{CO}_{2}}_{it-1}+ {\gamma }_{5}{lnLUC}_{it-1}+ {\gamma }_{6}{lnRP}_{it-1}+ \sum_{i=1}^{p}{\delta }_{1}{\Delta lnCP}_{it-k}+ \sum_{i=1}^{q}{\delta }_{2}{\Delta lnARF}_{it-k}+ \sum_{i=1}^{q}{\delta }_{3}{\Delta lnAT}_{it-k}+ \sum_{i=1}^{q}{\delta }_{4}{\Delta ln{CO}_{2}}_{it-k}+ \sum_{i=1}^{q}{\delta }_{5}{\Delta lnLUC}_{it-k}+ \sum_{i=1}^{q}{\delta }_{6}{\Delta lnRP}_{it-k}+ {\mu }_{i}+{\varepsilon }_{t}$$
(7)

where \({\alpha }_{0}\) is the intercept, \(\gamma\) is the coefficient of long-run variables, \(\updelta\) signifies the coefficient of short-run variables, p and q represent the number of lags, Δ is the first difference operator, \({\varepsilon }_{t}\) is the error term, and \({\mu }_{i}\) captures country-specific effects.

Dumitrescu–Hurlin panel causality test

The Dumitrescu–Hurlin causality test developed by Dumitrescu and Hurlin (2012) is a non-causality test for heterogeneous models of panel data with constant coefficients. The study implements this test to determine the causal association between average precipitation, mean temperature, CO2 emissions, cultivated land area, agricultural labor, and cereal crop yield. It is outstanding to note that Dumitrescu–Hurlin panel causality is applicable for heterogenous panels whether N > T or N < T. The causality test of Dumitrescu and Hurlin (2012) is specified as follows:

$${y}_{it}= {\upomega }_{i}+ \sum_{n=1}^{K}{{\varphi }_{i}}^{(n)}{y}_{i,t-n}+\sum_{n=1}^{K}{{\psi }_{i}}^{(n)}{x}_{i,t-n}+{\varepsilon }_{i,t}$$
(8)

where \({\upomega }_{i}\) indicates the intercept term, \({{\varphi }_{i}}^{(n)}\) represents the autoregressive parameter, \({{\psi }_{i}}^{(n)}\) signifies the slope coefficient that varies among cross-sections, x and y denote two stationary variables observed for N countries on T periods, and K denotes the lag length. Additionally, the null and alternative hypothesis for evaluating the Dumitrescu–Hurlin panel causality is expressed as follows:

$$\begin{array}{l}{H}_{0}: {\delta }_{i}=0 {\forall }_{i}=1,\dots ,N\\ {H}_{1}: {\delta }_{i}=0 {\forall }_{i}=1,\dots ,N\\ {H}_{1}: {\delta }_{i}\ne 0 {\forall }_{i}=N+1, N+2,\dots ,N\end{array}$$
(9)

The null hypothesis of the test claims that there is no homogenous causality among the whole cross-sections, while the alternative hypothesis confirms that there is evidence of at least one causal link in the panel data.

Empirical results and discussion

Descriptive statistics and correlation analysis

The descriptive statistics demonstrate the essential characteristics of the data from the selected East African countries. The mean, standard deviation, maximum, minimum, and the number of observations of the data are illustrated in Panel A of Table 2. The average cereal crop production exhibits the highest mean value of 5.516, whereas CO2 emissions had the lowest mean value of − 0.942. The average values of land under cereal cultivation and rural population were 5.375 and 0.887, respectively. Moreover, the mean values of climate change factors such as rainfall, and temperature, were 2.802 and 1.378, respectively. The land under cereal output shows the highest standard deviation of 1.807 compared to other variables, while temperatures demonstrated the lowest dispersion value at 0.053. Additionally, cereal production had the highest maximum value of all variables, although land under cereal cultivation had the lowest minimum value. On the other hand, the pair-wise correlation findings assess the degree to which two variables move together or avoid each other. As shown in Panel B of Table 2, all variables were positively correlated with cereal production except the average temperature and carbon emissions. Average rainfall had a negative association with temperature and carbon emissions. However, the pair-wise correlation matrix in Table 2 reveals that carbon emissions are positively related to average temperatures.

Table 2 Descriptive statistics and correlations analysis

Test of cross-sectional dependence and homogeneity

Examining the CD and slope heterogeneity of the variables impacting cereal production in East Africa is the initial step of the analysis. The CD test results detailed in Table 3 demonstrate that the null hypothesis of cross-sectional independence is rejected at the 1% significance level. This suggests that all variables under investigation have cross-sectional dependence. Moreover, the homogeneity of the slope coefficients was tested using Pesaran and Yamagata (2008). As shown in Table 3, the results confirm the rejection of the null hypothesis of homogeneity based on the statistical values of delta-tilde and delta-tilde adjusted regarding their probability values. The findings indicate that heterogeneity of the slope coefficients exists across different cross-sections. This proposes the appropriateness of heterogeneous panel estimators in our analysis.

Table 3 Test of cross-sectional dependency and homogeneity outcomes

Stationarity analysis

After determining the cross-sectional dependence and homogeneity, the subsequent step is to examine the stationarity of the variables and their corresponding orders of integration. Table 4 exhibits the findings of the panel unit root analysis. The results of the CIPS and CADF unit root tests indicate that the series are stationarity under different integration arrangements. The estimated findings reveal mixed stationarity of the variables, i.e. some are integrated at I(0) while others are stationary at I(1). Traditional cointegration approaches might lead to inaccurate inferences in the case of varying orders of integration. Hence, this indicates the appropriateness of the PMG technique for the current study.

Table 4 Panel unit root test findings

Panel cointegration analysis

Subsequently, we tested the cointegration relationship between the series by conducting Pedroni and Kao cointegration tests. The examined output of the Pedroni test demonstrated in Table 5 indicates that the null hypothesis of no cointegration is rejected for the test statistics of panel Phillips-Perron (PP) and ADF at the 1% significance level. To validate the cointegration results of the Pedroni test, the study implemented the Kao cointegration test which considers heterogeneity and cross-sectional dependence under the null hypothesis of no cointegration between the series. Thus, the outcome demonstrates that the null hypothesis of no cointegration is rejected at the 1% significance level for the modified Dickey-Fuller (DF), DF, and ADF tests, as shown in Table 5. Consequently, the findings of both tests confirm the long-run interconnections between the explained variable and the regressors.

Table 5 Panel cointegration tests

Long-run estimates

We approximated the long-run and short-run impacts of average rainfall, temperature, carbon emissions, cropped land area, and rural population on cereal output in East African economies. The findings displayed in Table 6 reveal that the chi2 statistic of the Hausman test is 4.42 with a probability value of 0.3525. This recommends that the PMG estimator is robust and more consistent to be interpreted for this analysis.

Table 6 Results from the PMG estimator

Primarily, the estimated long-run findings of the PMG model exhibited in Table 6 reveal that average rainfall has a favourable and significant impact on cereal yield in East African economies. Interpretively, a percentage rise in average rainfall, keeping other factors constant, contributes a 0.451% increase in cereal output at the 1% significance level. The positive influence of average rainfall on cereal production is consistent with the outcomes of Ozdemir (2022) and Warsame et al. (2021). However, the result contradicts the finding of Chandio et al. (2020), who found that rainfall hampers agriculture production in China. However, one striking outcome of the study shows that average temperature has negative and statistically significant influence on cereal output in the long run. This implies that a 1% rise in average temperature causes cereal production to decline by 0.296%. Recent studies by Chandio et al. (2020), Pickson et al. (2020), and Warsame et al. (2021) findings coincided with the unfavourable consequences of rising temperature on agriculture production that was observed in the current study. These outcomes elaborate that the cereal crop production in East African countries is subject to climate change. The climbing global temperature had apparent adverse effects on these countries' agriculture production, which showed a downward trend for the past decade. Notably, our findings counter Janjua et al. (2014), who concluded that global climate variability does not influence the agricultural output in Pakistan.

Moreover, carbon emissions were observed to expand cereal production in East African economies. This indicates that a 1% rise in carbon emissions significantly increases cereal production, on average, by 0.099%. The outcome that CO2 emissions in East African countries trigger agricultural output is comparable with Ahsan et al. (2020). They observed that carbon emissions boost the production of cereal crops in Pakistan. Additionally, the empirical results of Ntiamoah et al. (2022) assert that CO2 emissions improve cereal output in Ghana. In the long-run analysis, the study found that cropped area positively changes cereal crop production. This suggests that a percentage rise in the cultivated area improves crop production by 0.825%. Likewise, Ahsan et al. (2020) and Chandio et al. (2020) inspected that land under cereal crops favourably influences the agricultural output of China in the long-run. In addition, the study found that the rural population positively and significantly boosts cereal production. This implies that a 1% rise in the agricultural labour force increases cereal crop yield by 0.26% in the long-run. This finding is similar to Pickson et al. (2020), who observed that increased rural population contributes crucially to cereal production.

Short-run estimates

On the other hand, the short-run estimates presented in Table 6 outline that average temperature has an adverse and significant influence on cereal output. This indicates that a percentage increase in average temperature causes the cereal crops to decline by 1.830%. Pickson et al. (2020) discovered from China that average temperature rise negatively influences agriculture production in the short-run. Moreover, cultivated land area favourably and significantly impacts cereal yield. Interpretively, a 1% rise in cereal cultivated area in the short-run increases agricultural production by 0.676%. Similarly, the rural population has a constructive influence on cereal production. This implies that with a 1% rise in rural population, cereal production will increase by 2.403%. The outcome that land under cereal production and rural population enhance agricultural production in the short-run is in line with the recent outcomes of Ahsan et al. (2020) and Pickson et al. (2020). The short-run estimates from the study indicate that average rainfall and carbon emissions do not have any statistical impact on cereal production in the short run. The speed of adjustment toward long-run equilibrium from any short-run shock in the regressors is denoted by the error correction term (ECT). The most remarkable evidence reveals that the ECT is negative and significant, which indicates that short-run deviations that occur in crop production will be adjusted by the interested explanatory variables by about 43.4% annually.

Robustness analysis

The study utilized various cointegration techniques as robustness tests to validate the estimated parameters of the PMG estimator. The long-run estimates of fully modified ordinary least square (FMOLS) and dynamic ordinary least square (DOLS) are presented in Table 7. The results of the sensitivity analysis indicate that the sign and significance of the coefficients are in line with the PMG model estimates. Therefore, this supports that the PMG results of the study are reliable for policy making.

Table 7 Robust analysis of the long-run estimates

Dumitrescu–Hurlin panel causality test

In determining the causality direction of the scrutinized variables, the study has adopted the Dumitrescu-Hurlin panel causality technique. The empirical data presented in Table 8 show that, at the 10% significance level, the null hypothesis that average temperature variations do not homogeneously cause cereal crop production is rejected. This suggests that patterns of cereal crop output are considerably affected by fluctuations in temperature levels. Similarly, there is evidence to refute the null hypothesis that cereal crop production does not homogeneously cause average temperature changes at the 10% threshold. This finding demonstrates that variations in cereal crop production result in temperature changes. Likewise, Kumar et al. (2021) validated the presence bidirectional causality among average temperature and cereal crops in lower-middle-income countries. In contrast, the panel causality results of Pickson et al. (2022) indicate a unidirectional causality from temperature to crop output across 30 Chinese provinces. Even though the evidence supports the null hypothesis that variations in rainfall patterns do not cause changes in cereal output, we reject the null hypothesis that changes in cereal crop yield do not homogeneously cause changes in precipitation at the 5% threshold. Therefore, these findings imply that variations in crop production influence changes in average rainfall. However, some studies such as Attiaoui and Boufateh (2019) and Chandio et al. (2022a, b, c) found that changes in rainfall patterns lead to a crop production variations. According to IPCC (2001), droughts and floods are caused by changes in rainfall patterns and an increase in temperature levels.

Table 8 Dumitrescu–Hurlin panel causality test results

The findings in Table 8 demonstrate evidence to reject the null hypothesis that carbon dioxide emissions do not homogeneously cause a shift in cereal crop output at the 1% significance level. This suggests that carbon emissions across East African economies cause changes in the production of cereal crops. In addition, the analysis suggests rejecting the null hypothesis that changes in cereal crop production do not homogeneously cause changes in CO2 at the 1% threshold. Therefore, we can infer that changes in agricultural output granger cause the levels of emissions in East Africa. This is comparable to the findings of Chandio et al. (2022a, b, c) who observed that there is a bidirectional causality between carbon emissions and cereal production. Moreover, the study results indicate no evidence to reject the null hypothesis that land under cereal cultivation does not homogeneously cause changes in cereal crop production at the 1% threshold. This implies that the variation in the cropped land area considerably results in changes in cereal crop production. Likewise, the study suggests rejecting the null hypothesis that changes in cereal crop production do not homogeneously cause changes in the cropped area at the 1% threshold. The analysis infers that a shift in the output of cereal crops results in changes in land under cereal cultivation. Similarly, Pickson et al. (2022) reveal that there is a two-way causality between cultivated land area and crop yield. On the other hand, the study proposes rejecting the null hypothesis that shifts in the rural population do not homogeneously cause changes in the output of cereal crops at the 1% significance level. However, there is no evidence to reject the null hypothesis that cereal crop production does not homogeneously cause changes in rural population. This demonstrates that alterations in agricultural labour cause changes in cereal crop production in East Africa. Likewise, the evidence from Kumar et al. (2021) using a panel of lower-middle-income countries supports our findings that shifts in rural population lead to changes in cereal crops output.

Conclusion

Climate change has become an issue of concern for sustainable agriculture production. The low-income countries in East Africa are highly dependent on the agriculture sector, which constitutes a large portion of their GDP and employment. The sector has recently experienced a decline due to climatic variabilities. Hence, this study aims to investigate the effects of climate change on cereal crop production in East African countries during the period 1990 to 2018. The study implemented a panel ARDL cointegration approach to investigate the long-run and short-run relationship between climate change and cereal production in East African countries. The study has discovered the dependence of cross-sections, and the null hypothesis of homogeneity of the slope coefficients was rejected. Moreover, the findings of the CIPS and CADF unit root tests ascertained the order of integration of the variables to be a mixed order of stationarity, i.e. I(0) and I(1). Furthermore, the Pedroni and Kao cointegration tests have confirmed the long-run cointegration relationship between cereal crop production, average rainfall, temperature, carbon emissions, cultivated land area, and rural population.

The findings of the PMG estimator demonstrate that precipitation and carbon emissions have positive and significant consequences on agricultural production in the long run, although their short-term impacts were negligible. Besides, land under cereal cultivation and rural population is favourably associated with agricultural output both in the long-run and short-run. However, average temperatures negatively affect agricultural production in the long-run and short-run, even though the magnitude of agricultural output sensitivity to temperature is higher in the short-run. The findings of the PMG estimator had been validated by utilizing the panel FMOLS and panel DOLS; their long-run estimates showed similar signs and significance levels. Moreover, the results of the Dumitrescu-Hurlin panel causality test reveal a bidirectional causality between the output of cereal crops and temperature. The study further demonstrated a unidirectional causality running from cereal crop production to average rainfall. Additionally, a bidirectional causality was observed between carbon emissions and cereal crop output. Also, there is a bidirectional causal relationship between cropped areas and the production of cereal crops. However, there is a one-way causality running from rural population to cereal crop production.

The primary climate-related difficulties for East African countries are indeed the changing precipitation patterns and rising temperatures, which affected the livelihoods of agriculture-dependent households. Since the outcomes of the study emphasized that climatic events are critical to crop production, adaptive measures must be taken at the national and regional levels. Based on the study findings, several policy initiatives are necessary to overcome the adverse effects of climatic variations on sustainable agricultural yield. Firstly, governments should increase the capacity to adopt climate-resilient agricultural practices that diminish the magnitude of adverse climatic events, including floods and droughts. In this regard, implementing climate-resilient farming practices can provide sustainable solutions to unpredictable climatic effects. Second, since irregular rainfall patterns cause decreased crop yield, the East African authorities should assert the implementation of water management policies. One of the most effective ways to avoid the vulnerability of cereal crop production to rainfall fluctuations is to develop water retention facilities to irrigate rainfall-reliant farms during times of rainfall failure. This strategy is beneficial during the seasons, where the expected volume of rain is minimal or completely dry seasons. Another practical approach is establishing alternative irrigation systems, such as drilling dams, to ensure crop yields can survive the strains of changing climatic conditions. Subsidizing these irrigation facilities can reduce the complete dependence on rainfall for farming activities. Third, policymakers should improve the quality of the farm inputs by offering training and agricultural machinery to the farmers to boost their productivity. This can be achieved by enhancing the capacity of farmers to cope with climate change through training programs and developing their technical skills. Besides, the governments can also subsidize the acquisition of agricultural inputs such as tractors and fertilizers. Fourth, governments should establish crop diversification initiatives in cultivated land areas through agricultural investments to combat the negative consequences of climate change in East Africa. Expanding the crop production system requires research capabilities to create new cultivars and farming methods. Investments in efficient and resilient agricultural output through R&D, market-driven production systems, and sustainable agriculture technologies might lead to better varieties of cereal crops and create overall food security for the region. This will also diminish the effects of harsh weather on crops and could broaden the range of products that farmers may grow to sell. Fifth, there should be a consideration of farmers' income and crop yield losses due to the uncertainties related to climatic fluctuations. The increasing temperature and varying precipitation patterns are associated with more significant agricultural income losses. Therefore, policymakers should implement careful policy interventions, including pricing policies that could combat the consequences of income decline for the farmers.

One major limitation of this study that future studies should consider is the effects of fertilizer consumption on cereal crop production in East African nations. The use of fertilizers is crucial for raising the sector’s productivity even though its excessive use might lead to land degradation. Moreover, future studies should also consider the effects of climate change on disaggregated crops since climatic factors’ impacts vary from one crop yield to another.