Climate variability impacts on agricultural output in East Africa

Abstract This paper investigates whether the effects of weather variability in temperature and precipitation on agricultural output are short- or long-run. The contribution of this paper is twofold. First, the paper attempts to establish whether temperature or precipitation variability affects agricultural output in the short or the long run. Second, it examined whether the effects of temperature or precipitation variability on agricultural output are homogenous across East African countries. The results reveal that variability in temperature had a long-run impact on agricultural output, while variability in precipitation had a short-run effect. The findings also reveal that the long-run temperature variability effect was heterogeneous across East African countries, and to some extent, there is also evidence for the long-run effect of precipitation variability. These results are crucial in providing decision-makers and other interested parties a thorough evaluation of climate impacts and adaptation measures aimed at increasing agricultural production and food security.


Introduction
Africa is one of the continents most susceptible to climate change and fluctuation (Niang et al., 2014). The continent also has a poor ability for adaptation, leaving it particularly exposed and vulnerable due to high rates of poverty, financial and technological limitations, as well as a significant reliance on agriculture supported by rain. This region has seen substantial seasonal variability in rainfall and a rise in mean, maximum, and minimum temperatures over the past few decades (Gan et al., 2016;S.H. Gebrechorkos et al., 2018). East Africa in particular is vulnerable to climate change and climate extremes since its countries are heavily dependent on rain-fed agriculture, have high levels of poverty, and have low levels of education (Kotikot et al., 2018;Okumu et al., 2021).
In fact, there are already visible direct effects of climate change on the economic growth of climate-dependent sectors like agriculture, which account for 43% of the East Africa's gross domestic product (GDP) and affect the livelihoods of 80% of the region's general population (Waithaka et al., 2013).
There has been an increase in the amount of research seeking to quantify the economic effects of climate change (Dell et al., 2009(Dell et al., , 2012Deschênes & Greenstone, 2007;Fisher et al., 2012;Kurukulasuriya & Mendelsohn, 2007;Lippert et al., 2009;Mendelsohn et al., 1994). For instance, the pioneering work of Mendelsohn et al. (1994) strengthened the theoretical underpinning of the Ricardian approach to the economic analysis of the impact of climate change on agriculture. Previously, the traditional production function technique had overlooked farmers' ability to adapt to changing economic and environmental conditions.
In contrast, the Ricardian technique was a cross-sectional analysis that looked at how climate change and other variables influenced agricultural productivity over time (e.g., land values and farm revenues). This had the advantage of taking into account both the consequences of climate change and farmers' ability to adapt to them. Mendelsohn et al. (1994) emphasised the need for adaptation efforts, in which farmers maintain their operations in accordance with climate volatility in order to reap higher benefits from agricultural output. Deschênes and Greenstone (2007) assessed the economic impact of climate change on US agricultural land by estimating the impact of random year-to-year temperature and precipitation fluctuations on agricultural profitability. According to their study, climate change would have increased annual revenues by US$1.3 billion or 4.0 percent, year. Large negative or positive effects are unlikely since the 95 percent confidence interval runs from $0.5 billion to $3.1 billion.
In addition, there is also growing concern about the impact of climate change variability on agricultural production per season, particularly in East Africa (Abraha-Kahsay & Hansen, 2016;Alboghdady & El-Hendawy, 2016;Kogo et al., 2021;Matiu, Ankerst, Menzel et al., 2017;Ochieng et al., 2016). For instance, Matiu, Ankerst, Menzel et al. (2017), climate variability explains over 60% of yield variability and is a significant factor influencing food output and farmers' income. Abraha-Kahsay and Hansen (2016) found that precipitation variability has a negative effect on agricultural output in East Africa. Recently, Kogo et al. (2021) reveal that weather variability is also predicted to affect agricultural yields and patterns across a number of locations in Kenya.
However, these studies employed a variety of methods. Early empirical research on climate and agricultural output used cross-sectional regression analysis (Sachs & Warner, 1997), which is subject to omitted variable bias (Hsiang et al., (2017). As a result, cross-sectional regressions might lead to biased estimates of climate change and agricultural output. Early studies also examined the relationship between weather shocks and agricultural output use fixed effects panel regression models (Abraha-Kahsay & Hansen, 2016;Regan et al., 2019). Because fixed effects models account for unobserved time-invariant group heterogeneity, such as variations in institutions, these models are less susceptible to omitted variable bias. They have been used to investigate the link between weather variability and agricultural output (see, Abraha-Kahsay & Hansen, 2016;Barrios et al., 2008;Burke & Emerick, 2016;Deschênes & Greenstone, 2012;Fisher et al., 2012;Regan et al., 2019;Seo, 2013).
The inability of fixed effects models to account for long-term climatic variability is their limitation. The distinction between short-term extreme occurrences and long-term consequences is critical, since farmers may be better able to respond to long-term changes than to short-term or catastrophic events, by investing in either adaptation or mitigation. Mitigation and adaptation are two important tools for reducing the risks associated with climate variability.
Although there are few empirical research studies on long-run effects of climatic factors on agriculture output, they are crucial for policymakers to implement the policies that lessen the susceptibility of poor farmers to climate change. Examining the effects of climate change on agricultural production in this context, especially for certain African nations, under short-run and long-run distinctions, will add to the ongoing debate in the current literature on climate change and its effects on agriculture.
The studies of Blanc (2012), Kalkuhl and Wenz (2020), and Salahuddin et al. (2020) Ozdemir (2022 are among the exception, as they assess the long-run impact of climate change in the agriculture sector and the environment in general. Kalkuhl and Wenz (2020) explicitly assessed the effect of short-term weather shock and long-term climate change on the gross regional product and found that temperature affects productivity. If the global mean surface temperature rises by 3.5°C by 2100, worldwide production will be reduced by 7-14%, with much greater losses in tropical and poor nations. East Africa is particularly vulnerable to climate change and climate extremes due to its nations' high levels of poverty, reliance on rain-fed agriculture, and low levels of education. This might undermine efforts put in place by East African governments.
According to the African Development Bank Group report 2019 (Attiaoui & Boufateh, 2019), East Africa economy is expected to grow at a healthy rate of 5.9 percent in 2019 and 6.1 percent in 2020. The nations with the fastest economic development are Djibouti, Ethiopia, Rwanda, Tanzania, and Kenya. However, the region still faces a number of downside risks that might jeopardize opportunities for development and economic progress. The major concerns include agriculture's reliance on exporting primary commodities, susceptibility to natural disasters, and rising oil costs in nations that import oil.
Other study by Ozdemir (2022) looked at how the short-and long-term impacts of climate change on variables in agricultural productivity in Asia between 1980 and 2016 using dynamic and asymmetric panel autoregressive distributed lag estimators. He found that the climate change variable and agricultural productivity have a long-run relationship. Other studies like Gul et al. (2022) and Baig et al. (2022) also found that climate variables have a long-run effect on the agricultural products.
However, these studies did not account for the effect climate change variability on the agricultural output in the short and long run. Moreover, these studies did not account for the heterogeneous effect of climate variable of the agriculture across countries and mostly based outside Africa.
Our study joins the scant literature that assesses the long-term relationships. We investigate the relationship between climate variability (precipitation and temperature) and agricultural output across East African countries. Our study addresses two policy-relevant issues: (1) Does temperature or precipitation variability affect agricultural output, and if so, is the effect short-or long-term ? (2) Is the effect of weather variability on agricultural output homogenous across East Africa?
The assumption that parameters are homogeneous across nations is one of the limitations of panel estimates. Based on the potential of different agricultural systems to expand, and the prevalence of such systems in each of the nations we studied, we expect the impact of temperature and precipitation to be heterogeneous.
Unlike recent studies, this study employs a set of second-generation panel data techniques that account for cross-sectional dependence and cross-country heterogeneity-issues that the first generation of panel data estimation techniques fail to address. To the best of our knowledge, Blanc (2012) and Ozdemir (2022) are the only studies that assess the impact of climate change on agricultural output in the long run by considering cross-country dependency. However, these studies assessed the effect of weather-related variables such as temperature and precipitation, but did not include the variability that exists in those variables.
Nowadays, the economies of the world have become more integrated, economically and financially, than they were a few decades ago; thus, not accounting for cross-sectional dependency (CD) across countries might lead to misleading results.
The results reveal that variability in temperature has a long-run impact on agricultural output, while variability in precipitation has a short-run effect. The results also show that the long-run temperature variability effect is heterogeneous across East African countries; to some extent, there was also evidence of the long-run effect of precipitation variability. After taking into consideration that countries are different in economic structure and dependent on each other, the findings reveal that precipitation variability effects are noticed in a few countries, such as Djibouti, Ethiopia, Rwanda and Uganda.
The structure of this paper is as follows: the literature is presented in section 2, and methodologies in section 3; section 4 reports findings, and section 5 concludes.

Literature review
Climate change can reduce food availability and affect the access to food and the quality of food. The reduced agricultural output may be the result of expected temperature rises, modifications to precipitation patterns, modifications to extreme weather events, and decreases in water availability. Therefore, the effects of climate change on agricultural production must thus be carefully considered by policymakers in the agriculture industry. Essentially, different settings may be used to study the impacts of climate change on agriculture, particularly the "Ricardian technique" and "time series/panel data approach" (Mendelsohn, 2008).
With the assumption that land rent would reflect the long-term net productivity of farmland based on survey or country-level data, the Ricardian approach focuses on the estimates of the cost of climate changes by analysing associations between land value and agro-climatic variables using the net revenue climate response function (Gbetibouo & Hassan, 2005;Kabubo-Mariara & Karanja, 2007;Lan-Huong et al., 2019;Mendelsohn & Dinar, 1999Mendelsohn et al., 1994Mendelsohn et al., , 1996Nguyen & Scrimgeour, 2022;De Salvo et al., 2013;Severen et al., 2018).
On the other hand, as more data have been available, time series/panel data models have gained popularity. Utilising this method, researchers have also looked at the relationship between the weather and the agricultural output (Sarker et al., 2012;Ortiz-Bobea et al., 2021;Mubenga-Tshitaka et al., 2021;Akpoti et al., 2022;Ozdemir, 2022;Song et al., 2022;Carr et al., 2022;Etwire et al., 2022). The effects of climate change on the physical and biological have been documented in the past (McCarthy et al., 2001;Parmesan & Yohe, 2003). However, only a few studies have examined the short-and long-term effects of climate change on agricultural production using cutting-edge panel data approaches. For instance, Ozdemir (2022) looked at the short-and long-term impacts of climate change on agricultural productivity in Asia between 1980 and 2016 using dynamic and asymmetric panel autoregressive distributed lag estimators. The findings confirmed that there is existence of a long-run relationship between climate variables and only CO 2 emissions had an effect in the short run. Other studies investigated the effects of climate change factors in the long run. Gul et al. (2022) investigated how key food crop yields in Pakistan from 1985 to 2016 were affected by climate change factors like average temperature and rainfall patterns as well as non-climatic factors like the area devoted to crops with high yields, fertilizer use, and formal credit. After using an autoregressive distributed lag (ARDL), the results confirmed the long-run relationship between climatic and non-climatic factors to the major food crop yield in Pakistan. This study's findings also pointed that temperature has a variety of effects on the yields of important food crops, whereas the production of key food crops is positively impacted by the area planted with these crops, the average rainfall, the fertilizer used, and formal credit. Baig et al. (2022) investigated the asymmetric dynamic relationship between climate change variables and the production of rice in India for the period spanning from 1991-2018. They considered the nonlinear autoregressive distributed lag (NARDL) model and Granger causality approach. The findings revealed that the mean temperature had a negative impact on the production of rice in the long run but positively affects the production in the short run. Other studies like Zaied & Cheikh (2015), Guntukula & Goyari (2020), Abbas (2020), Chandio et al. 2020a), Attiaoui & Boufateh (2019), Chandio et al. (2021), have investigated the long-run relationship between climate-related variables and the agricultural output and confirmed that the climate variables had a negative long-run effect on the agricultural output. In addition, Chandio et al. (2020b) provided evidence of short-and long-run effects of CO 2 emissions and average temperature on the cereal yield in Turkey, whereas average rainfall indicated a positive effect on the cereal yield in both short and long run. In contrast, Rehman et al. (2020) in their study investigating the climatic and carbon dioxide emissions impact on maize crop production in Pakistan found that there is a positive and long-run relationship between CO 2 emissions and maize crop production.
However, most of these study did not account for the cross-sectional dependence in the estimation. Assume that cross-sectional independence might lead to biased output and wrong conclusions (Lanzafame, 2014). Studies like Ozdemir (2022) are among the few that assess the long-run relationship between climate-related variables and agricultural output without assuming cross-sectional independence. Ozdemir (2022) showed that there is a long-run relationship between climate variables and agricultural productivity in Asian countries but only the CO 2 emissions had an impact in the short-run. They added that the CO 2 emissions effects turn from positive in the short-run to negative in the long-run.
Moreover, the importance of weather variability in the growing season has increased and has been noticed in the literature (Conway & Schipper, 2011;Mutai & Ward, 2000). In particular, the estimates of climate change in southern Africa have also revealed that variability and extreme events occurrences may become more common in the future (Tadross et al., 2005). In addition, concern over how much weather variability affects East African agriculture is growing (Wheeler at al., (2000); Barrios et al., 2008;Abraha-Kahsay & Hansen, 2016;Ochieng et al., 2016;Kogo et al., 2021). For instance, the false start of the growing season, which is a part of the beginning variability associated to agronomic drought and has a negative influence on agricultural productivity, is made worse by climate variability. Farmers frequently become confused about when to begin planting crops due to the false start of the growing season, which has an impact on seed germination and subsequent normal growth. Abraha-Kahsay and Hansen (2016) estimated a production functions for agricultural output in East Africa, using climatic variables broken down into growing and non-growing seasons. The results reveal that growing-season precipitation variability has a significant detrimental impact on plant growth after using the fixed-effect model.
Most of the conducted studies on the impact of climate change variability on the agriculture output consider precipitation and temperature as proxy of climate change. Additionally, they overlooked the possibility the presence of common factors that may contribute to the problem of cross-sectional dependency. African nations interact on a political, economic, social, and cultural level. They are also impacted by common phenomena like climate change, political unrest, the financial crisis, price shocks on global markets, energy use, etc. These articles do not consider cross-sectional dependency. They assume that countries are cross-sectional independent. When panel data is used, all of these variables may result in cross-sectional associations. Due to the assumption of cross-sectional independence, typical panel estimators produce biased outputs and draw the wrong conclusions (Lanzafame, 2014). Blanc (2012) and Ozdemir (2022) are the only studies conducted in Africa that have taken into account cross-sectional dependency in their analysis of the impact of weather-related variables on agricultural output, but they did not consider the impact of long-run weather variability. Our study too did not assume crosssectional independence. Contrary to most studies on the impact of weather variability on agricultural output-such as Abraha-Kahsay and Hansen (2016); Kogo et al. (2021) However, contrary to Blanc (2012) and Ozdemir (2022), who considered the long-run effects of temperature, rainfall and evaporation, did not consider the long-run effect of the variability of these weather variables. We also attempt to assess whether the effects of variability in temperature and precipitation on agricultural output are homogeneous in the long run.

Methodologies
Nowadays, it is essential to use the correct econometric approach when determining how changes in one or more factors may affect economic variables. Cross-sectional dependency (CD) and slope heterogeneity are two technical considerations that are overlooked by conventional econometric methods. Studies such as Bersvendsen and Ditzen (2021) and Espoir et al., (2022) propose adopting a proper econometric technique that considers two technical points: slope heterogeneity, and cross-sectional dependency.
First, because the world economies have become more financially and economically connected in the last three decades, testing for cross-sectional dependency (CD) before panel causality analysis is now required. The econometric literature has firmly determined that panel datasets are likely to show substantial CD as a result of this integration (Pesaran, 2004). This dependency may arise as a result of shared shocks, technical cross-country spillovers, market integration, and unobserved components that eventually become part of the error term (Espoir and Ngepah, 2021). If the errors (ε i;t ) are not independent across units, failing to account for cross-sectional dependency might lead to erroneous causality results (Herzer & Vollmer, 2012). Second, when it comes to slope heterogeneity, panel data methodologies estimate variations in between cross-sectional units by fixed constants (using fixed, random effects technique and the generalised method of moments). However, individual heterogeneity in slopes among cross-sectional units may be found in some panel datasets. Overlooking this variability may bias the results of causal relationships and lead to erroneous conclusions (Bersvendsen & Ditzen, 2021;Chang et al., (2015)). Ignoring slope heterogeneity incorrectly leads to biased findings (Pesaran & Smith, 1995).
For these reasons, this study examines the issue of cross-sectional dependence and slope heterogeneity before assessing the causal relationship between weather variability and agricultural output. Consider a Cobb-Douglass production function of agriculture; our study's functional form is as follows: where Q represents agricultural production, L stands for labour, K stands for capital such as land or machinery or animals, and I stands for additional elements such as fertiliser and irrigation. For this study, the baseline regression is presented in the following way: where Output it and Output itÀ 1 are the total agriculture production of the country and the lag of the total agriculture production I (i = 1,2, � � � n) in year t(t = 1,2 ; � � � ; T). We include three capital inputs: Land, Machinery, and Livestock. We also include Labour, Fertiliser and Irrigation; μ i is the unobserved time-invariant country-specific effect, and ε it is the error term.

Cross-section dependence (CD)
When working with long-term panel data, it is possible to run into the cross-sectional dependency problem among cross-sectional units. An independent cross-sectional assumption would provide false findings. To counter this, Pesaran's (2004) cross-sectional dependence test is used to determine if cross-sectional units are independent or dependent. The null hypothesis indicates independence, whereas the alternative hypothesis suggests a dependency, CD statistics ¼ ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi 2t in which the mean is zero and the variance is one, and ρ denotes the pairwise correlation. For the null hypothesis, cross-sectional dependency does not exist; the alternative hypothesis implies that there is a cross-sectional dependency between cross-sectional units.

Unit root tests
To cope with cross-sectional dependence, it is important to use a consistent unit root econometric method. This study uses a second-generation unit root test. If there is no link between the crosssections, according to the Pesaran CD test findings, first-generation unit root tests are utilised. If there is a dependence between cross-sections, however, second-generation unit root tests should be used. The second-generation tests that account for cross-sectional dependency are MADF (Taylor & Sarno, 1998), SURADF (Bai & Ng, 2004;Breuer et al., 2002), PANKPSS (Carrion-i-Silvestre et al., 2005), and CADF (Pesaran, 2007). Pesaran (2007) introduced the CADF (Cross-Sectionally Augmented Dickey-Fuller Test) panel unit root test to account for cross-sectional dependency. This test, which may be used in both T > N and N > T situations, extends the basic ADF (Augmented Dickey-Fuller Test) regression with initial differences and lagged values of horizontal sections. The CIPS test examines the unit root characteristics of the whole panel; it is based on the CADF test. The estimation equation and hypotheses are as follows: Hypotheses of the CIPS test: H 0 indicates that the series is not stationary; H 1 indicates that the series is stationary. The cointegration technique used by Westerlund and Edgerton (2007) was selected for our investigation. Westerlund and Edgerton (2007) developed a panel cointegration test that allows for dependency both within and between cross-sectional units, as well as correlation both within and between cross-sectional units, based on the Lagrange multiplier test of McCoskey and Kao (1998). In this test, a sieve sampling technique is used as a basis. It has the benefit of lowering the asymptotic test distortions substantially.

Panel LM bootstrap cointegration test
To conclude, all units in the panel are cointegrated according to the null hypothesis. In order to estimate long-term and short-term coefficients, the Pooled Mean Group Model (Panel ARDL) approach is employed.

Pooled Mean Group Model (Panel ARDL) and Dynamic Fixed Effect (DFE)
For panel cointegration analysis, M. H. Pesaran et al. (1999) proposed the PMG technique (Pooled Mean Group/Panel ARDL). A version of this approach has been developed for the ARDL model. This model allows estimating both short-term and long-term slope coefficients within the scope of the panel cointegration. According to this technique, constant variables, short-term coefficients and error terms can be changed across sections. While this technique does not allow for the change of long-term coefficients between units, it does allow for heterogeneity and the change of errorcorrection terms across groups in the short-term period. We can rename the explanatory variables in Equation (2) as X for convenience; the Autoregressive distributive lag (ARDL) (p, q) dynamic specification can be written as where Ln (Output) is the dependent variable and X is the k x 10 vector of the explanatory variables. λ ij denotes scalars, and μ i represents the group-specific fixed effect, while p and q represent lags of dependent and independent variables changing from country to country. The fact that the variables here are cointegrated in the order of I (1). and the error terms I (0) indicates that there is a long-term relationship.
However, deviations from the long-term balance may occur. With a vector error correction model (VECM) to be established, deviations from long-term equilibrium can be expressed as: where ϕ i stands for the speed of the error correction coefficient. If the error correction coefficient is zero, then there is no short-term connection, according to the definition. This coefficient is anticipated to be negative and smaller than 1. A large amount of time is required for this approach, because of the correlation between the error term and the estimators whose difference was subtracted from the average.
In our study, the time dimension is large, making this technique suitable. While the constant parameter may be changed in the Pooled Mean Group estimator, the slope parameter cannot be changed. The Dynamic Fixed Effect estimator, on the other hand, assumes that all parameters are constants. Pooled Mean Group Estimators and Dynamic Fixed Effect Estimators are used to estimate short-and long-term parameters in our investigation.

Random coefficient regression model
To check whether the slope coefficients are not consistent or homogeneous across panel units, the Swamy (1970) random linear regression model is used. The Swamy (1970) random-coefficients linear regression model does not need to impose the assumption of consistent parameters across panels.
Parameter heterogeneity is addressed as a stochastic variation in a random-coefficients model. Let assume that where i ¼ 1; . . . ; m and β i is the coefficient vector (K x 1) for the cross-sectional unit, such that To find β and � , the estimator is developed under the assumption that the cross-sectional specific coefficient vector β i is the result of a random process with a mean vector β and covariance matrix �, where E ω i ð Þ ¼ 0, and where �;E ωω 0 ð Þ represents the block diagonal matrix with � i , i ¼ 1; along the main diagonal and zeroes elsewhere. The Generalised Least Squares (GLS) estimate of β is where representing the GLS estimator, is a matrix-weighted average of the panel-specific OLS estimators. The variance of β is: For more information about the slope and heterogeneity, see Swamy (1970).
In the presence of cross-sectional dependency and slope heterogeneity, using an econometric approach that imposes homogeneity requirements and ignores spatial interaction effects to assess panel causality between weather variability and agricultural output may provide incorrect results.

Data
We compiled a panel of nine nations (Burundi, Djibouti, Ethiopia, Kenya, Rwanda, Somalia, Sudan, Tanzania and Uganda) for our research, covering the period from 1961 to 2016. As in Abraha-Kahsay and Hansen (2016), the nine countries were chosen due to their similar crop production season characteristics. Data points were gathered from FAOSTAT (2011). As a dependent variable, the FAO's net production index was considered for this study. It is considered a proxy for total production output and includes both crop and livestock production, as well as other agricultural outputs. Land input is considered a proxy for total area used for agricultural purposes, while machinery input is measured by the total number of tractors used. For livestock capital input, we employed the headcount for cattle, sheep and goats. Labour is measured by the percentage of the population working in agriculture. Agriculture's fertiliser input is taken to be the number of metric tons of plant nutrients used. The consideration of these variables follows numerous studies (see, Abraha-Kahsay & Hansen, 2016; Barrios et al., 2008). Mean annual temperature and precipitation data were collected from the Climate Research Unit (CRU), as per Barrios et al. (2008) and Abraha-Kahsay and Hansen (2016).
We measured variability as the deviation of the previous year's rainfall and temperature from the 30-year historical average during crop seasons (Amare et al., 2018). Variability is also referred to as rainfall and temperature anomalies. Figure 1 reports the general trends in precipitation and temperature during the period under consideration.
In general, the average annual temperature is increasing, and the trend becomes more significant as time goes by, while the opposite trend is observed for precipitation. The results are partly in line with studies such as S. H. Gebrechorkos et al. (2019), which reported that long-term seasonal rainfall did not show a significant trend (a decreasing trend in the east part of Ethiopia, an increasing trend in Kenya, and a decrease for Tanzania) during the long rainy season. The same study also reported that there is an increasing trend in the maximum and minimum temperatures for virtually the whole eastern region. Table A1 and A2 in the appendix report the descriptive statistics and the results of the Dumitrescu-Hurlin panel causality test for economic and climate variables.

Empirical analysis
To analyse the time-series characteristics, we took three preliminary steps. First, we looked for cross-sectional dependencies and slope heterogeneity between the variables across panel units. Second, we evaluated the panel unit root using specialised tests that accommodate the presence of cross-sectional dependency based on affirmative evidence. Finally, we examined whether there is a long-term or cointegration between the agricultural output and the rest of the covariates. If the unobserved dependency in the error terms is overlooked, it might lead to spurious results (Herzer & Vollmer, 2012).
For that, a cross-sectional dependency analysis was performed. The findings of the Pesaran CD test are shown in Table 1. Table 1, the null hypothesis of no cross-sectional dependence is rejected at the 1% level of significance, and we can conclude that there is cross-sectional dependence in the data. As a result, these data demonstrate that the variables considered had considerable cross-sectional dependence throughout the period 1961-2016. This finding suggests that agriculture output and other covariates have substantial nearby interaction effects and likely to follow similar transmission mechanisms throughout East Africa. This is in line with one of the objectives of the East African Community (EAC) that strives to increase and strengthen cooperation among the partner nations and other regional economic communities for their mutual benefit in a variety  of political, economic, and social spheres. Any study that assesses the impact of weather variability on agricultural output without taking cross-sectional dependence into account might result in misleading findings. Increased economic integration and trade volume and other natural phenomena processes like climate change might be linked to an increase in dependency, and the results of the cross-sectional analysis confirm this. These nine East African economies have an influence on each other's economic development. Since there is cross-sectional dependency, the firstgeneration unit root tests are invalidated by these findings. Since cross-sectional units are dependent and heterogeneous, second-panel unit root tests will be used in this research. Pesaran (2007) CIPS unit root test results are considered in this study.

Similar to the results in
We also check for country-specific homogeneity in the slope coefficients. Using Equation (2), we use the H. M. Pesaran et al. (2008) slope heterogeneity test, and the outcomes are shown in Table 1, part B. At the 1% level of significance, the null hypothesis of slope homogeneity is tested and rejected for all panel units. This means that panel regressions that assume slope homogeneity constraints may provide false conclusions and misleading findings. Our study will account for the country-specific features by making use of appropriate estimation techniques.
The CIPS test, which is one of the second-generation unit root tests that considers crosssectional dependence, is used in our study. The results are reported in Table 2. Based on the results, the order of integration is mixed, i.e. I (0) and I (1).
Because some variables are stationary at level and others are stationary at the first difference, the predicted results reveal a mixed integration order. Using the Pesaran (2007) CIPS, the findings were achieved for both intercept and intercept and trend. Our results are consistent with those by Ozdemir (2022).
According to Table 2, Ln (machine), Ln (fertiliser), Ln (temperature), Ln (precipitation), Ln (temperature variability) and Ln (precipitation variability) are stationary at level. On the other hand, Ln (land) is not stationary. The findings of Ln (output), Ln (livestock), and Ln (irrigation) are complex. Ln (output) and Ln (livestock) are stationary at a 10% level of significance based on the intercept model, but non-stationary based on the intercept and trend model. This leads us to conclude that the two series are not stationary. After computing the first difference, the null hypothesis of panel non-stationary is rejected at a 1% level of significance for all variables. Due to this, we concluded that all our variables were integrated of order one (1). This means that there might be at least one long-term equilibrium relationship between the variables. Hence, there is a necessity for panel cointegration testing.
As cross-sectional units are Pedroni (1999Pedroni ( , 2004 cointegration, metrics are incorrect; an appropriate econometric cointegration method should be considered for efficient results. Ignoring heterogeneous slope coefficients and cross-sectional dependencies in panel data might lead to biased and inconsistent conclusions (2020).
For these reasons, we employ the Westerlund and Edgerton (2007) cointegration test in order to confirm if the cointegration relationship exists in the long run. This is a panel cointegration test that uses error correction. Westerlund's panel test for cointegration is more robust, according to Hossfeld (2010), because it deals with these issues by detecting structural breakdowns and cross-sectional dependency endogenously. In the presence of heterogeneous and dependent cross-sectional units, this method is appropriate. Using the Westerlund test, one may determine whether there is an error correction for each panel unit or for the complete panel. Statistical categories are broken down into two subcategories, each of which has two statistics in it. The two statistics of the first category are identified as the group mean statistics (G t ; G a ). The two statistics are known as the group mean statistics, while the second two statistics of the category are recognised as panel statistics (P t , P a ). In both cases, they are pooling information concerning the error correction term along the cross-sectional dimension of the panel. The decision whether to reject the null hypothesis is based on the significance of the majority of the four statistics (Miti ´c et al., 2017). Table 3 reports the estimated Westerlund and Edgerton (2007) panel cointegration results.
They reveal that under the null hypothesis of panel, no cointegration was ruled out. Except for G t (which is not significant), the remaining findings, for G a , P t , and P a , respectively, are statistically significant at 1 and 10% levels of significance. It appears that the long-term cointegration relationship between variables is well supported by the calculated coefficients. This implies the existence of at least one long-run relationship between agricultural output and the regressors. Pooled Mean Group Analysis is employed to assess the short-and long-term relationships between the series in order to obtain coefficients. Table 4 reports the outcomes of the pooled mean group (PMG) estimators. Table 4 has two parts. The coefficients of the long-term relationship are presented in the first part. The short-term relationship coefficients are presented in the second part. We report a reduced version of the model, where the insignificant independent variables are eliminated successively. Models (1) and (2) consider only the impact of the temperature and variability in temperature on agricultural output, while Models (3)  The estimated parameters for the physical inputs considered in this study do not vary across the models specified, and all have the expected signs. The specification in Model (4) confirms the findings except for the land coefficient, which is a positive but not significant coefficient. The irrigation coefficient showed no significance across all specifications and has been removed. The lack of significance of the irrigation parameter is not a surprise, as 95% of farming in this part of
We also find that machinery has a significant impact on agricultural output, contrary to the findings of Erikson et al. (2008) and Abraha-Kahsay and Hansen (2016). This is due to the fact that the fixed effect model used in those papers does not account for variable that varies over time. A specific country might through a national programme increase the number of machines used in the agriculture sector, while a pool mean estimator technique permits a greater degree of parameters heterogeneity in the long run than usual estimator techniques. In addition, it allows also heterogeneity in the short-run relationship (Simões, 2011).
East Africa, which is predominantly dominated by the agriculture sector, can adopt programme to promote this sector. For instance, Xia (2021) reveal that a small number of Chinese investorsmany of whom have prior expertise in agricultural trade-have demonstrated increased interest in agricultural investment in countries like Kenya and Tanzania than other sectors. This has promoted the mechanization of the agricultural sector. This heterogeneity effect of machinery can be seen clearly in Table 6.
Looking at the effect of variable climate on agricultural output, we find that on average, temperature and variability in temperature have a negative and significant effect on agricultural output in the long run. Our findings are partly in line with Baig et al. (2022) who found show that mean temperature has a short-term positive impact on the output but a long-term detrimental impact. In general, temperature and precipitation variations affect crop yields, as do growing CO 2 concentrations in the atmosphere (Wheeler & Von Braun, 2013). Temperature and water quantity are key variables for crop growth; thus, greater temperatures have a detrimental impact on soil quality and soil moisture. However, temperature increases are most likely to have a negative influence on agricultural yields (Ottman et al., 2012). The high temperature observed in the long run is detrimental, as it increases water stress. A reduction in fuel emissions to keep global warming at 1.5 °C is therefore urgently required (IPCC, 2018).
For policy intervention, this information is crucial, as it shows that the impact of the increased temperature in the agricultural sector in East Africa is more of a long-run phenomenon. Any policy measure intending to reduce the effect of water stress will improve agricultural output, since precipitation and its variability tend to have an effect only in the short run. In East Africa, without irrigation the region's agriculture is subject to rainfall unpredictability and dry periods, even during the rainy season (Mupangwa et al., 2006), putting more stress on the agricultural sector. Policymakers should coordinate efforts to invest in irrigation quickly, in order to ensure food security.
Looking at the short-term relationship, the second part of Table 4 reveals that the error correction coefficient is negative, as theoretically expected. The error correction coefficient is found to be statistically significant with the expected sign, which supports the cointegration test results. The speed of adjustment tends to increase when one considers Models (1) and (2), where the temperature is considered. The estimated coefficients for physical inputs have the expected sign, but are not significant-except for the labour coefficient, which does have a negative sign but is still not significant. This is because most driving force in the agriculture sector in the short run is climate-related variables than economic variables. The coefficients of temperature are not significant, but have the expected sign. We found that annual precipitation has a positive and significant impact on output in East Africa, while precipitation variability has a negative and significant effect on agricultural output in the short run-in line with Abraha-Kahsay and Hansen (2016), who found that growing variability is having a serious negative effect on East African agricultural output and that the effect is more pronounced during the main growing season. This is because the East Africa region in particular is characterised by an increase in weather variability, especially in the main growing seasons, spring and autumn (Conway & Schipper, 2011;Schreck & Semazzi, 2004). Table 5 reports findings from the dynamic fixed-effect model and consists of two parts. The first part shows the coefficients of the long-run relationship, and the second reports the short-run relationship. Labour and livestock are significant, with the expected sign, in the long run. Other variables have the expected sign, except for machinery and fertiliser; but not all are significant.
Looking at climate variables, the results reveal that both temperature and precipitation are not significant, but have the expected sign. The variability in both temperature and precipitation is not significant in the long term.
The second part of Table 5 reports the short-run relationship. The error correctional model has the expected sign, and variables are significant across all specifications. Land and livestock are the only parameters that are significant with the expected sign across all specifications in the short run. Climate variables have the sign expected, but are not statistically significant.
Given that the PMG gives only the cross-heterogeneous effect in the short term and the weighted-average effect in the long term, it is also possible to obtain the heterogeneous longrun marginal effect of climate variability on output. According to PMG results, for instance, weather-related variables affect the agricultural output across nine countries in the same manner. These results contradict the IPCC (2007) that emphasises that even though climate change is a global phenomenon, its effects vary from one region to another depending on various socioeconomic factors. It is crucial to assess the marginal effect of weather-related variables on each country under investigation.
We carry out the analysis one step further to investigate the heterogeneous effect of climate variables on agricultural output across the nine East African countries. Table 1, part B reports the results of H. M. Pesaran et al. (2008) and confirm that the slopes are heterogeneous. We apply the Swamy (1970) random coefficient linear regression model, which does not impose the assumption of constant parameters across the panel. The results are reported in Table 6.
The estimated coefficients for the physical outputs and climate variables do vary across countries. In Burundi, most of the inputs have the expected sign, but are not significant, except livestock input, which is significant, but without the long-run effect of climate variables on output. In Djibouti, labour and livestock are significant, with the expected sign, while other physical inputs have the expected signs, but are not significant, except that machinery does have a negative sign but is not significant. We found evidence of the impact of climate variables in this country. The average temperature and precipitation and their variability have an impact on agricultural output in the long run. In Ethiopia, machinery, labour, land and fertiliser are significant and positive, but the land coefficient is negative and significant. Land in Ethiopia has deteriorated due to climate change, which has had a negative effect on agricultural output. Teshome (2016), for instance, reveals that an increase in temperature, a decrease in rainfall and abnormal precipitation are increasingly making households vulnerable in rural Ethiopia. This is in line with our findings: we found that annual temperature and precipitation have a negative long-term impact on agricultural output. This is in contrast to what we reported in Table 4, where the effect was only coming from temperature in the long run.
In Kenya, only the average temperature has a long-run impact on output. Machinery, livestock, labour and fertiliser have an impact on output in the long run in Kenya. Rwanda also shows a significant positive impact of the physical input parameters on the agricultural output; except for machinery, which is positive but not significant. Results show that in the long run, temperature and precipitation have an effect, but so does temperature variability. In Somalia, the land variability had a negative effect on agricultural output, confirming the presence of climate change in this region. Labour and fertiliser parameters are positive and significant. We find that only temperature has a negative impact in Somalia. In Tanzania and Uganda, temperature has a long-term impact on the agricultural sector, while no effect is observed in Sudan. In Tanzania, there is also the longrun impact of precipitation variability on output.

Conclusion
This empirical study aimed to investigate the relationship between weather variability and agricultural output in the long run. In particular, we investigated the relationship between precipitation and temperature and agricultural output across East African countries. The contribution of this paper is twofold. First, the paper attempted to establish whether temperature or precipitation variability affects agricultural output in the short or the long run. Second, it examined whether the effects of temperature or precipitation variability on agricultural output are homogenous across East African countries. For that, we considered economic data from the FAOSTAT from 1961 to 2016 and climate data from the Climate Research Unit (CRU). We first tested whether there was cross-sectional dependency in the data; if this had been the case, the first-generation panel econometric techniques would not have been applicable. Variability in temperature and precipitation are measured as the deviation of the previous year's precipitation and temperature from the 30-year historical average. Variability is referred to as rainfall and temperature anomalies observed during the period under consideration. We found that variability in temperature had a long-run impact on agricultural output, while variability in precipitation had a short-run effect. We also found that the long-run temperature variability effect was heterogeneous across East African countries, and to some extent, there was also evidence for the long-run effect of precipitation variability.
As per our study findings, it is recommended that studies on the impact of climate change on agricultural output should consider the cross-sectional dependency that exists between countries, as countries do not have the same agricultural system. In addition, the effects of temperature and precipitation variability are different between the short run and the long run. The effect of temperature and precipitation variability on agricultural output is a specific-country reality, due to the different responses that have been put in place. Policies intended to promote irrigation in East Africa can have a significant impact; especially in the short run, precipitation variability is more serious in the short run. There should also be investment in technology, as agricultural technology provides farmers with several benefits including improved production, and crops that are more adaptable to climate change.
In addition, in order to increase crop production and achieve food security while reducing the challenges brought on by climate change, governments can play a critical role by encouraging appropriate farm-level adaptation measures, providing timely early warning information on seasonal climate forecasts, and developing supportive policies and investments.
Finally, there are several caveats to this study. First, results from this study are different from those of previous studies, as we attempted to investigate the long-run impact of weather variability on agricultural output. The generality of previous studies should be viewed with caution, as there is evidence of a substantial increase in weather variability in the growing seasons (Abraha-Kahsay & Hansen, 2016; Kogo et al., 2021;Ochieng et al., 2016). Future studies should investigate the long-run impact of growing season temperature and precipitation variability on agricultural output under the assumption of cross-dependency in the panel data.
In addition Kogo et al. (2021), revealed that climate change and variability would continue to have detrimental effect the crop production and food security to the already vulnerable communities in countries like Kenya. Future research should also consider investigating the long-run relationship between temperature and precipitation variability on different types of crops, as such effects cannot be captured when one uses an aggregate variable. This relationship might also be investigated at two levels: at the agricultural system and household level.