Introduction

The term “greenhouse effect” has been used extensively to explain the phenomenon of climate change. These greenhouse gases have a substantial impact on the atmosphere and health. They cause respiratory diseases due to smoke and air pollution and, at the same time, change the climate by trapping heat. Besides, severe weather, rising sea level, increasing forest fires, and food disruption are the additional effects of climate change due to greenhouse gases. Carbon dioxide (hereafter CO2) is one of the leading greenhouse gases, which consists of about three-quarters of emissions. At the beginning of 2020, the CO2 level reached 412 ppm.Footnote 1Footnote 2 Human activity has led to a tremendous rise in the amount of carbon dioxide (Li 2016); in particular, the burning of organic matter and deforestation have increased such emissions by about 43% since the beginning of the industrial age. Furthermore, some recent studies have argued that sustainable economic growth is impossible without reducing carbon dioxide emissions (Lackner 2010; Luo et al. 2017). Climate change is happening so fast that it has led to an alarming increase in temperature, sea level, and CO2 emissions that cannot be ignored at any cost. That is why the US government and many other countries have passed many environmental laws to deal with climate change’s negative impact.

Recently, researchers, academicians, and policymakers have expressed a keen interest in policy uncertainty and economic activity in various ways. In particular, they pay more attention to promoting global economic recovery. Current studies, however, have described policy uncertainty as uncertainty about the future policies as enforced by governments, especially in the areas of regulatory, monetary, fiscal, taxing, and environmental policy that ultimately affect market volatility, economic activity, and the environment in which firms and households are working (Handley and Limao 2015; Azzimonti 2018; Julio and Yook 2016; Baker et al. 2016). Additionally, for this purpose, researchers have used numerous proxies to measure the effect of policy uncertainty on the real economy (Davis 2016; Jurado et al. 2015; Azzimonti 2019; Strobel 2015; Baker et al. 2016). Baker et al. (2016) developed an economic policy uncertainty (hereafter EPU) index based on the frequency of significant newspaper articles that includes specific words related to uncertainty. Davis (2016) compiled a monthly global EPU index, which is the GDP-weighted average of the national EPU index for sixteen countries. In contrast, Azzimonti (2019) constructed a Trade Partisan Conflict Index. They follow the affluence of newspaper articles that cover political controversy in trade policies.

In the last decade, especially after the global financial crisis in 2007–2008, several studies have shown that EPU has an adverse impact on GDP (Balcilar et al. 2016; Kang et al. 2020) and other economic activities such as investment (Gulen and Ion 2016; Wang et al. 2014), stock market liquidity (Dash et al. 2019), FDI (Albulescu and Ionescu 2018; Chen et al. 2019a), tourism (Dutta et al. 2020), and biofuel (Uddin et al. 2021), which in turn could significantly impact environmental quality. This is because the growing EPU and its adverse effects on real economic activities may temporarily divert the government’s attention from environmental issues. This could reduce the government’s and business’s efforts to control carbon emissions, affecting local protection policies to some extent. Secondly, this increasing EPU and its adverse effects on the economic situation and firms’ performance can decline economic demand. This could significantly reduce the personal income of the household and corporate profits. Therefore, companies can compromise on using cheaper energy sources to cover their losses, which may cause a significant increase in carbon emissions. Hamilton (1983) indicates that policy uncertainty and energy consumption can be strongly linked, as fluctuations in energy prices due to supply and demand shocks and a slowdown in economic growth may affect firms and household energy consumption ( Degiannakis et al. 2018; Antonakakis et al. 2014; Aloui et al. 2016; Hailemariam et al. 2019; Rehman 2018; Olanipekun et al. 2019).

There are relatively few researchers who observe the relationship between EPU and CO2. It is closely related to very few recent studies (Pirgaip and Dinçergök 2020; Jiang et al. 2019). Jiang et al. (2019) study the nexus between EPU and CO2 to use US sector data to illustrate the effect of institutional factors behind it. They found that there was a Granger causality between EPU and CO2 growth. Pirgaip and Dinçergök (2020) examine the link between EPU, energy consumption, and CO2 in G7 countries. They showed unidirectional causality from EPU to CO2 emissions in Canada, Germany, and the USA. Adedoyin and Zakari (2020) found that unidirectional causality exists from EPU to CO2. And EPU moderates energy consumptions-CO2 nexus in both the short run and long run. However, these studies ignore the role of foreign direct investment (FDI) in the EPU-CO2 nexus. FDI has been a critical component of economic growth and an essential means of transferring modern technologies to the host country and providing employment (Demena and van Bergeijk 2019; Sapkota and Bastola 2017). Especially in current years, the inflow of FDI has become vital compared to international TRADE as it increases productivity (Chen and Moore 2010; Demena and Murshed 2018; Zhao and Zhang 2010), and it has grown faster than the world trade or world output.

On the other hand, one of the most important and commonly raised concerns about FDI is the potential damage to the environment. Furthermore, FDI-related environmental costs are often overlooked due to promoting growth with FDI (Demena and Afesorgbor 2020; Zhu et al. 2016). Therefore, in this study, we examine the effect of EPU and FDI on CO2. Figures 1, 2, 3 show the trends in CO2, EPU, and FDI from 2001 to 2019 in 24 developed and developing countries, respectively.

Fig. 1
figure 1

Trends in the CO2 emissions in 24 developed and developing countries from 2001 to 2019.

Fig. 2
figure 2

Trends in the economic policy uncertainty in 24 developed and developing countries from 2001 to 2019.

Fig. 3
figure 3

Trends in the FDI in 24 developed and developing countries from 2001 to 2019.

Our study contributes to the existing literature in the following manner. Firstly, this study observes the relationship between EPU, FDI, and CO2 emissions by first-time employing comprehensive panel data of 24 countries compared to early literature having either concentrated on a single country or a minimal number of selected countries, which could bias the generalizations. Secondly, economic analysis has led to the design of modern environmental regulation techniques over the last few decades. Therefore, this study will guide in formulating and evaluating environmental policies that will help achieve environmental goals at the lowest possible cost under traditional regulations. Thirdly, it can draw necessary implications for the policymaker to understand the role of FDI in achieving carbon reduction goals, because FDI reflects the investment in production facilities, and it is far more critical for developing countries. Therefore FDI not only can increase resource and capital formation, but, maybe, more importantly, it is an excellent tool for transferring production technologies, entering new international markets, enhancing capabilities, reducing unemployment, improving skills, and introducing modern and innovative organizational and management methods between different locations. Finally, we used the cross-section dependency approach, cross-section augmented Dickey-Fuller (CADF), cross-sectional augmented IPS (CIPS) panel unit root methods, and Westerlund and Edgerton (2007) bootstrap panel co-integration test to check the stationarity, dependency, and co-integration among parameters. We employ the dynamic seemingly unrelated regression (DSUR) for long-run estimates and the vector error correction model (VECM) to detect the direction of causality. Besides, we use the dynamic common correlated effects technique (DCCET) and fixed effect panel quantile regression approach to check the findings’ robustness.

Using an annual panel data of 24 countries for the period 2001–2019, we find that EPU significantly increases the selected countries’ CO2 emission level. The finding of EPU is consistent with the outcome of Adedoyin and Zakari (2020). They reported that EPU degrades the environment of the UK. Although FDI has an adverse influence on CO2, it shows that FDI reduces environmental pollution and consistent with prior studies (Al-Mulali and Tang 2013; Jiang et al. 2018; Sung et al. 2018), supporting the pollution halo hypothesis. Finally, we use the employ panel VECM Granger causality test to confirm the causal link. The outcomes of VECM Granger causality show that the long-run causality can be identified in the equations of FDI and TRADE. Likewise, in the short run, there exist unidirectional Granger causal associations from CO2 emissions to FDI, EPU to CO2 emissions, EPU to FDI, FDI to EC, FDI to GDP, EC to CO2 emissions, EC to EPU, EC to GDP, EC to TRADE, and GDP to EPU. Furthermore, there exist bidirectional Granger causal associations from Trade to FDI and Trade to FDI.

The rest of the papers are as follows. The “Literature review” section presents a brief literature review of the study. The “Data and methodology” section introduces the source of data and methodology. The “Results and discussion” section shows the results of empirical analysis and discussion, and the “Conclusion and policy implications” section concludes along with policy implications.

Literature review

The rapid increase in fossil fuel use has led to a dramatic rise in atmospheric carbon dioxide (CO2) levels in recent years. Because CO2 emissions are the most important supplier to greenhouse gas emissions, this increase is a cause of concern worldwide. There are numerous empirical studies on CO2 and macroeconomic variables that examine the environmental Kuznets curve (EKC) hypothesis using specific countries and regions (Ahmad et al. 2020; Shahbaz et al. 2017; Uddin et al. 2017). This study investigated the influence of EPU and FDI on CO2 emissions. So we start this work with the help of EPU-CO2 emission and FDI-CO2 emission relationship.

Economic policy uncertainty-CO2 emission nexus

The existing literature described the EPU as the uncertainty related to government regulatory, fiscal, monetary, taxation, and environmental policies, which ultimately lead to market fluctuations and impact the economic outcome and the environment in which economic agents work. Recent literature has shown the different effect of uncertainty on various real economic activities (Junttila and Vataja 2018; Bernal et al. 2016), corporate investment (Gulen and Ion 2016; Drobetz et al. 2018), trade (Asiedu 2006; Feng et al. 2017; Handley and Limao 2015), cost of borrowing (Çolak et al. 2017; Kelly et al. 2016), cash holding (Demir and Ersan 2017; Shabir et al. 2021) stock returns (Phan et al. 2018; Krol 2014; Li et al. 2015), asset pricing (Brogaard and Detzel 2015; Pástor and Veronesi 2013), tourism (Dutta et al. 2020), biofuel (Uddin et al. 2021), and environmental pollution (Adedoyin and Zakari 2020; Jiang et al. 2019; Pirgaip and Dinçergök 2020).

The EPU affects CO2 directly through the policy modification effect and indirectly through the economic demand effect. Jiang et al. (2019) analyze the connection between EPU and CO2 to explain the effects of institutional forces that increase in CO2 emissions using US sector-level data. They found a Granger causality between EPU and CO2. Moreover, CO2 emissions influenced EPU when CO2 is in both higher/lower growth period. CO2 emission is influenced by EPU when carbon emissions grow in low or high growth periods. Adedoyin and Zakari (2020) employed the ARDL and ECM to examine the link between EPU, energy consumption, and CO2 emissions in the UK from 1985 to 2017. This study shows that uncertainty in economic policy plays an essential part in reducing pollution in the UK, especially in the short run. In the long run, EPU increases the CO2 emission level. Pirgaip and Dinçergök (2020) used a bootstrap panel Granger causality test. They examined the connection between EPU, energy consumption, and CO2 emissions by using an annual dataset from 1998 to 2018 in G7 countries and showed that causality relationships exist between different countries within the G7. Adedoyin et al. (2021) show that EPU plays a significant role in deteriorating environmental quality, while Liu and Zhang (2021) and Wang et al. (2020) find a significant positive correlation between EPU and CO2 emissions.

Uncertainty in economic policy may indirectly affect carbon emissions through economic demand; an increase in uncertainty adversely impacts the economic situation and reduces the economic demand for energy consumption. The existing studies have shown that firms employ more conservative policies during high EPU times. Bloom (2014) showed that a rise in uncertainty usually drives to a slowdown in firm employment and investment behavior because, during higher uncertainty periods, investment and spending are less attractive to the household and companies (Bloom 2009), raise the cost of borrowing (Çolak et al. 2017), cause the firms to hold cash more (Phan et al. 2019), enhance the exchange rate and stock market volatility (Christou et al. 2017; Krol 2014), negatively impact the trade (Asiedu 2006; Feng et al. 2017), and adversely affect the whole economic growth (Balcilar et al. 2016; Bloom 2009). Recently Nilavongse et al. (2020) examine the impact of EPU shocks on the UK economy. They show an adverse effect of the EPU on domestic industrial production and argued that EPU is a key source of fluctuations in the real exchange rate, while Uddin et al. (2021) indicate that the higher uncertainty enhances significant positive changes in ethanol and palm oil prices.

Numerous recent researchers have studied the effects of policy uncertainty on firms’ export activity. Julio and Yook (2016) analyzed the US firms’ FDI and their foreign partners to assess the influence of uncertainty on FDI by using the timing of national elections in host nations to cause fluctuations in policy uncertainty. They reported that the FDI of US firms significantly decreased during the election period and increased after the uncertainty reduction. Handley and Limao (2015) also show that uncertainty influences exports. Therefore, we hypothesize that EPU can influence CO2 emissions by affecting economic activity.

Foreign direct investment-CO2 emission nexus

The FDI impact on the environment has been discussed in several studies (Baek 2016; Haug and Ucal 2019; Liu et al. 2018; Shahbaz et al. 2018; Zhang and Zhang 2018; Sapkota and Bastola 2017). Some research indicates that FDI enhances CO2 emissions (Tang and Tan 2015; Al-mulali 2012; Sabir et al. 2020; Lan et al. 2012). On the other hand, some researchers suggest that a rise in FDI contributes to reducing carbon dioxide (Hao et al. 2020; List and Co 2000; Mert and Bölük 2016; Mielnik and Goldemberg 2002; Zhang and Zhou 2016). The pollution-haven hypothesis is one of the popular views that support the link between FDI and environmental pollution (Tang and Tan 2015; Copeland and Taylor 1994; Walter and Ugelow 1979). Based on this hypothesis, international firms relocate highly polluting industries to nations with fewer environmental rules to prevent high regulations in their nations. As a result, developing countries are suffering from more environmental pollutants and become pollution-havens. Pao and Tsai (2011) applied the co-integration technique to determine the connection between CO2 emissions, FDI, energy consumptions, and economic growth for BRIC countries for 1980 and 2007 and recognized the positive impact of FDI on CO2 . Baek (2016) examine the relationship between FDI, energy consumptions, and CO2 by using pooled mean group (PMG) estimator of dynamic panels on ASEAN countries for 1981–2010 and confirm the pollution-haven hypothesis and show that FDI had increased CO2 emissions. Zhang (2011) analyze the relationship between financial developments and environmental degradations and pointed out that FDI is widely introducing carbon-intensive construction methods and enhanced CO2 in China. Similar results were found by the following studies of Lan et al. (2012), Lee (2013), and Lau et al. (2014).

On the other hand, the pollution halo hypothesis suggests that international firms transfer their green technology to developing/host countries through FDI (Güvercin 2019; Kim and Adilov 2012). Therefore, FDI can help to decrease environmental pollution. Al-Mulali and Tang (2013) examined the connection among pollution, FDI, and energy consumption in the GCC from 1980 to 2009. Moreover, their result endorses the pollution halo hypothesis and shows that FDI helps reduce CO2. At the same time, GDP and energy consumption are the primary cause of pollution in GCC countries. Mert and Bölük (2016), using unbalanced panel data from 21 Kyoto countries, studied the influence of renewable energy consumptions and FDI on CO2. Besides, their outcomes indicated that FDI leads to clean technology and enhances environmental quality that supports the pollution halo hypothesis. Mielnik and Goldemberg (2002) provided related outcomes in emerging economics and suggested that FDI harms CO2 emissions. Zhang and Zhou (2016) and Hao et al. (2020) used panel data on the province level and evidenced that FDI reduces CO2 emissions and supports the pollution halo hypothesis. Some studies reject both hypotheses and find that FDI does not affect CO2 emissions (Atici 2012; Shaari et al. 2014), while numerous other studies support conclusive results (Haug and Ucal 2019; Keho 2015; Lee 2013; Chandran and Tang 2013; Perkins and Neumayer 2009; Shahbaz et al. 2015a; Yildirim 2014).

Data and methodology

Data description and empirical framework

This study analyzes the relationship between economic policy uncertainty (EPU), foreign direct investment (FDI), and CO2 emissions considering the critical role of energy consumption (EC), economic growth (GDP), and trade openness (TRADE). Balcilar et al. (2016) and Kang et al. (2020) claimed that EPU is not only harmful to economic progress as well as EPU affects CO2 directly through the policy modification effect and indirectly through the economic demand effect (Jiang et al. 2019). FDI has been an important factor of economic development and a crucial means of shifting new technologies to the host country for sustainable development (Sapkota and Bastola 2017; Demena and van Bergeijk 2019). In addition, the linkage between FDI and environmental performance is influenced by the link between FDI and economic growth (Shahbaz et al. 2015b). EC has a negative and significant effect on the quality of the environment, because the economic progress of any country generally relies on fossil fuels that lead to increase environmental pollution (Chandio et. 2021). Yang et al. (2020a) and Yang et al. (2020b) argued that GDP is the main cause of high CO2 emissions since the advancement of an economy depends on high energy use, which eventually affects the quality of the environment. The impact of TRADE could have a positive and adverse effect on the environment. Adverse expectations involve large carbon-emitting expertise, massive usage of transportation for exports and imports, and so on (Antweiler et al. 2001). On the other side, TRADE will augment revenue and support the spread of eco-friendly technologies between nations. Established on these assertions, we project the specific CO2 emission model as follows:

$$ {CO}_{2 it}=f\left({EPU}_{it},{FDI}_{it},{GDP}_{it},{EC}_{it},{TRADE}_{it}\right) $$
(1)

where CO2 is carbon dioxide emissions, EPU indicates the economic policy uncertainty index, FDI is donating foreign direct investment, GDP is economic growth, EC represents energy consumption, and TRADE is trade openness. For empirical examination, we converted all parameters to natural log in order to utilize a log-linear formation as a replacement for a linear formation. According to Shahbaz et al. (2012), a log-linear configuration gives much more persistent and accurate results. The log-linear function of CO2 emissions is as follows:

$$ {LnCO}_{2_{it}}={\alpha}_0+{\alpha}_1{LnEPU}_{it},+{\alpha}_2{LnFDI}_{it},+{\alpha}_3{LnEC}_{it},{\alpha}_4{LnGDP}_{it},+{\alpha}_5{LnTRADE}_{it}+{\varepsilon}_{it} $$
(2)

where in Eq. (2), ln is natural log, i is the number of a cross-section of countries, t is the number of years, and εit shows an error term. We assume that EPU decreases environmental performance if α1>0 otherwise α1<0. We expect α2<0 if the association between FDI and CO2 emissions is negative if not α2>0. We assume that EC degrades the environmental performance α3>0 if not α3<0. We suppose α4>0 if the association between GDP and CO2 emissions is positive otherwise α4<0. We expect that trade openness increases CO2 emissions and hinders environmental quality if α5>0 if not α5<0.

We utilize panel data from 2001 to 2019 of 24 developed and developing countriesFootnote 3. The selection of the time frame and countries of this study depends on the availability of data (i.e., EPU). Unfortunately, only 26 countries from different world regions are listed on the website (https://www.policyuncertainty.com) regarding EPU data. Therefore, due to accessibility and the employment of a balanced panel dataset in this research, only 24 economies were selected for the parameters in consideration. Ultimately, the scarcity of statistics in the rest of the countries resulted in a sample of 24 nations between 2001 and 2019. The data on CO2 emissions (million tonnes) were downloaded from the BP statistical review (BP, 2019). The data on EPU (measure as an index of policy uncertainty) were developed by Baker et al. (2016)Footnote 4 and downloaded from the website (https://www.policyuncertainty.com), while the data of FDI (% of GDP), GDP (constant 2010 US$), EC (million tonnes of oil equivalent), and TRADE (% of GDP) are gathered from World Development Indicators (WDI) of the World Bank. Details of the variables and their sources can be seen in Table 1.

Table 1 Description and data source

Econometric methodology

The model’s evaluation continues as follows: (a) a CD (cross-sectional dependence) analysis is executed to see whether there is cross-sectional dependency (CSD) across the panel; (b) if CSD is found, a suitable panel unit root test (i.e., CIPS and CADF) is run to see if the variable is stationary; (c) the Pedroni, Kao, and Westerlund and Edgerton co-integration tests are applied to confirm the long-run connection among the variables; (d) we employ the DSUR for long-run estimates; besides, we use the dynamic common correlated effects technique (DCCET) and fixed effect panel quantile regression approach to check the robustness of the results; (e) the VECM approach is used to detect the short and long-run direction of causality.

Cross-sectional dependency test

The problem of cross-sectional dependency occurs in the panel dataset, and without overcoming these issues, the data might lie through biased prophecy. Therefore, following Chen et al. (2019b), we employed the following four essential and often used techniques: (1) LM test by Breusch and Pagan (1980), (2) Pesaran (2004) suggested scaled LM test, (3) Baltagi et al. (2012) proposed bias-corrected scaled LM test, and (4) Pesaran (2004) advocated CD test. The null hypothesis (H0) of these methods specified that all the above variables are not cross-sectionally dependent.

Panel unit root test

Due to the cross-sectional dependence in our data, we do not use the first-generation unit root test because it may drive biased results. Therefore, we employed second-generation advanced unit root approaches to observe the data’s stationarity to handle this issue. We used Pesaran (2007) CIPS and CADF unit root techniques that are more suitable to give reliable outcomes even if the data has existed cross-sectional (Saud et al. 2019; Ahmad, et al. 2021). Therefore, Pesaran (2007) CADF unit root is as follows:

$$ \Delta {y}_{it}={\alpha}_i+{\rho}_i{y}_{it-1}+{\beta}_i{\overline{y}}_{t-1}+\sum \limits_{j=0}^k{\gamma}_{ij}\Delta {\overline{y}}_{it-1}+\sum \limits_{j=0}^k{\delta}_{ij}{y}_{it-1}+{\varepsilon}_{it} $$
(3)

where \( {\sum}_{j=0}^k{\gamma}_{ij}\Delta {\overline{y}}_{it-1} \) indicated the lagged terms of cross-sectional averages and \( {\sum}_{j=0}^k{\delta}_{ij}{\overline{y}}_{it-1} \) indicates the first difference value of individual time series. The CIPS unit root test equation can be started by obtaining a t-value from the mean values of individual CADF.

$$ CIPS=\frac{1}{N}{\sum}_{i=1}^N{CADF}_i $$
(4)

Panel co-integration test

In the next stage, we check the co-integration between the included variables by employing the panel co-integration technique. Therefore, we used three different econometric techniques: (a) Pedroni (1999) and Pedroni (2004) suggested an approach that is recognized as the Pedroni co-integration test; (b) a technique introduced by Kao (1999) was recognized as the Kao co-integration test; and (c) Westerlund and Edgerton (2007) proposed a panel bootstrap co-integration test that permits residual correlations among specific cross-sections, that is a suitable approach in the co-integration analysis. So, following You et al. (2020) and Mensah et al. (2020), we employed these three co-integration approaches, as in panel-level data, it solves several issues and provides fair results. Besides, our data has cross-sectional dependence; therefore, Westerlund and Edgerton’s (2007) co-integration approach is applied to solve cross-dependency and get more consistent findings.

Long-run estimations

Since co-integration test above endorse the co-integration among the variable, we now calculate the regressors’ long-run elasticities with CO2. We applied the second-generation econometric technique reported by Mark et al. (2005) and recognized it as dynamic seemingly unrelated regression (DSUR). DSUR can handle cross-sectional dependency and other issues related to panel data and offer reliable outcomes. Therefore, following Yang et al. (2020b) and Rua (2018), this study uses the DSUR technique to quantify the variables’ long-run elasticities.

The present study also examines the robustness of our outcomes through the Chudik and Pesaran (2015) recommended dynamic common correlated effects technique (DCCET) to evaluate the panel data series having cross-sectional dependence. The DCCET is formulated on the ideas of the pooled mean group (PMG) approach established by Pesaran et al. (1999); Pesaran and Smith (1995) developed the mean group (MG) method, and common correlated effect (CCE) estimation was suggested by Pesaran (2006). According to Ahmad et al. (2021), DCCET is chosen over the static model for two crucial reasons: (i) DCCET records the model dynamics, which can affect the assessed errors of the model, or else. (ii) Through DCCET, we can solve endogeneity because it incorporates the endogenous variable’s lag term as an explanatory variable. Moreover, this technique is also appropriate for small sample size by utilizing the jackknife correction method (Chudik and Pesaran 2015). This method is also helpful in the presence of structural breaks in the data (Kapetanios et al. 2011), and also it can be used in the unbalanced panel data (Ditzen 2018). The dynamic equation of DCCET can be written as follows:

$$ {\mathrm{LnCO}}_{2\ \mathrm{it}}={\alpha}_i{\mathrm{LnCO}}_{2\ \mathrm{it}-1}+{\delta}_{\mathrm{i}}{X}_{\mathrm{i}\mathrm{t}}+\sum \limits_{p=0}^{\Pr }{\gamma}_{\mathrm{xip}}{\overline{X}}_{t-p}+\sum \limits_{p=0}^{\Pr }{\gamma}_{\mathrm{yip}}{\overline{Y}}_{t-p}+{\mu}_{\mathrm{i}\mathrm{t}} $$
(5)

In this equation, LnCO2 indicates a log of carbon emissions, and its lag is used as an independent variable. Xit represents a set of independent variables, and PT denotes cross-sectional averages of the lag.

Similarly, this study also applied quantile regression for robustness which is a more diversified tool that gives a more profound and better sense of CO2 emission provider which specifies the conditional distribution of the dependent variable across various countries and years, giving complete outcomes in different conditional distributions (Zhang et al. 2016). The traditional OLS does not handle the skewness of data, and it is a normal distribution, which may lead to biased and inefficient outcomes. Conversely, the quantile regression accounts for this issue because it is less sensitive to the outliers. Therefore, we use the fixed effect panel quantile regression techniques to determine the effect of EPU and FDI on CO2 particularly the conditional distribution of the nations with a lower and higher level of CO2 emissions. So we can write panel quantile regression with fixed effects as:

$$ {Q}_{{\mathrm{y}}_{\mathrm{i}}}\left({\tau}_{\mathrm{k}}|{\alpha}_{\mathrm{i}},{x}_{\mathrm{i}\mathrm{t}}\right)={\alpha}_{\mathrm{i}}+{\beta x}_{\mathrm{i}\mathrm{t}}^{\prime}\left({\tau}_{\mathrm{k}}\right) $$
(6)

y is conditional quantile, x is a vector of explanatory variables, β is slope coefficients, and αi is the individual-specific fixed effect parameter.

Panel VECM-based causality test

A Granger causality analysis is built to look for any causal relationships between variables. A Granger causality analysis implies that the parameters remain stationary; otherwise, it can produce incorrect findings (Granger and Newbold 1974). When utilizing an error correction method (ECM)-driven vector autoregressive (VAR) causality analysis that uses data stationary at 1st difference, this issue is eliminated. The VAR model is enhanced with a one-period lagged error correction term derived from the co-integrated framework. There are two steps to measure this technique. In the first phase, we calculate long-term causality by estimating the ECM. Secondly, we also use the Wald statistic to assess short-term causality. As a result, the augmented Granger causality analysis with ECM is as follows:

$$ \left(\begin{array}{c}\begin{array}{c}\begin{array}{c}\Delta \mathrm{ln}\ {\mathrm{CO}}_{2 it}\\ {}\Delta \mathrm{ln}\ {\mathrm{EPU}}_{it}\end{array}\\ {}\Delta \mathrm{ln}\ {\mathrm{FDI}}_{it}\\ {}\Delta \mathrm{ln}\ {\mathrm{EC}}_{it}\end{array}\\ {}\Delta \mathrm{ln}\ {\mathrm{GDP}}_{it}\\ {}\Delta \mathrm{ln}\ {\mathrm{TRADE}}_{it}\end{array}\right)=\left(\begin{array}{c}\begin{array}{c}\begin{array}{c}{\theta}_1\\ {}{\theta}_2\end{array}\\ {}{\theta}_3\\ {}{\theta}_4\end{array}\\ {}{\theta}_5\\ {}{\theta}_6\end{array}\right)+\sum \limits_{k=1}^P\left(1-L\right)\left(\begin{array}{c}\begin{array}{c}\begin{array}{c}{\partial}_{11}{\partial}_{12}{\partial}_{13}{\partial}_{14}{\partial}_{15}{\partial}_{16}\\ {}{\partial}_{21}{\partial}_{22}{\partial}_{23}{\partial}_{24}{\partial}_{25}{\partial}_{26}\end{array}\\ {}{\partial}_{31}{\partial}_{32}{\partial}_{33}{\partial}_{34}{\partial}_{35}{\partial}_{36}\\ {}{\partial}_{41}{\partial}_{42}{\partial}_{43}{\partial}_{44}{\partial}_{45}{\partial}_{46}\end{array}\\ {}{\partial}_{51}{\partial}_{52}{\partial}_{53}{\partial}_{54}{\partial}_{55}{\partial}_{56}\\ {}{\partial}_{61}{\partial}_{62}{\partial}_{63}{\partial}_{64}{\partial}_{65}{\partial}_{66}\end{array}\right)\left(\begin{array}{c}\begin{array}{c}\begin{array}{c}\Delta \mathrm{ln}\ {\mathrm{CO}}_{2\mathrm{it}-\mathrm{k}}\\ {}\Delta \mathrm{ln}\ {\mathrm{EPU}}_{\mathrm{it}-\mathrm{k}}\end{array}\\ {}\Delta \mathrm{ln}\ {\mathrm{FDI}}_{\mathrm{it}-\mathrm{k}}\\ {}\Delta \mathrm{ln}\ {\mathrm{EC}}_{\mathrm{it}-\mathrm{k}}\end{array}\\ {}\Delta \mathrm{ln}\ {\mathrm{GDP}}_{\mathrm{it}-\mathrm{k}}\\ {}\Delta \mathrm{ln}\ {\mathrm{TRADE}}_{\mathrm{it}-\mathrm{k}}\end{array}\right)+\left(\begin{array}{c}\begin{array}{c}\begin{array}{c}{\mu}_1\\ {}{\mu}_2\end{array}\\ {}{\mu}_3\\ {}{\mu}_4\end{array}\\ {}{\mu}_5\\ {}{\mu}_6\end{array}\right){ECM}_{it-1}+\left(\begin{array}{c}\begin{array}{c}\begin{array}{c}{\omega}_{1\mathrm{it}}\\ {}{\omega}_{2\mathrm{it}}\end{array}\\ {}{\omega}_{3\mathrm{it}}\\ {}{\omega}_{4\mathrm{it}}\end{array}\\ {}{\omega}_{5\mathrm{it}}\\ {}{\omega}_{6\mathrm{it}}\end{array}\right) $$
(7)

where t shows the time period (2001–2019), i is the number of a cross-section of countries, (1–L) is the lag operator, ECMit-1 signifies the one-period-lagged error term derived from the co-integrating vector, and ωit shows the residual term.

Results and discussion

Empirical results

The results of summary statistics and pair-wise correlation from 2001 to 2019 for CO2, EPU, FDI, EC, GDP, and TRADE are described in Table 2. The correlation analysis findings illustrate a significant positive association between CO2 emissions and explanatory variables except for FDI, positing a significant negative association.

Table 2 Descriptive statistics and pair-wise correlation

The results of all the cross-section dependence (CSD) tests indicate that we reject the null hypothesis (H0) of no CSD in panels, except the results of CO2 in column 4 (see Table 3). The prob. values of CO2 in columns 1, 2, and 3 and all other explanatory variables (i.e., EPU, FDI, EC, GDP, and TRADE) in all four columns validate that all factors are cross-sectionally dependent, respectively. It implies that uncertainty or disruption of one country also upset other countries in the panel.

Table 3 Outcomes of cross-section dependence test

Table4 contained the outcomes of CADF and CIPS unit root approaches. The findings of these tests posit that only EPU and FDI are stationary at a level. Thus, we take the first difference of all the variables to make them stationary. After taking the first difference, CIPS and CADF provide ample proof to reject the null hypothesis (H0 = panel contain unit root). Thus, at order one [I(1)], all factors are integrated, which shows all variables satisfy the co-integration test’s presumption.

Table 4 Panel unit root test

In general, Table 5 shows the findings of the Pedroni and Kao co-integration tests. We conclude that there are long-term connections among parameters across all nation groups based on prob. values from the most of the tests. The prob. values of these methods demonstrate that we have ample proof to take alternative hypotheses and reject the null hypothesis of no co-integration.

Table 5 Outcomes of panel co-integration test

Despite the fact that Pedroni’s test of co-integration is often used in the research due to its effectiveness, it pales in the existence of residual cross-sectional dependency across series within a panel data. As a result, we used a panel bootstrap co-integration analysis that includes residual correlations between individual cross-sections to assess the validity of our initial findings. Table 6 presents the results of the Westerlund-Edgerton (2007) co-integration test. The Ga and Pt tests robust prob. values provide sufficient evidence that there is a co-integration connection between EPU, FDI, EC, GDP, and CO2.

Table 6 Results from Westerlund and Edgerton (2007) bootstrap panel co-integration test

Now, we continue to examine the elasticities of EPU, FDI, EC, GDP, TRADE, and CO2. For consistent and reliable outcomes, we used the DSUR technique. Table 7 confirms that all variables are significantly linked to the CO2 at various significance levels. The EPU is positive and statistically significant, which shows that a 1% increase in EPU is related to a 0.1870% growth in CO2 emissions. We also note that the FDI coefficient is statistically significant and negative, specifying that a 1% rise in FDI is related to a 0.0048% decline in CO2. Moreover, the EC coefficient is statistically significant positive and depicts that a 1% surge in EC is linked with a 1.0451% decrease in environmental quality. Regarding GDP, the coefficient of GDP shows a positively significant relationship with CO2 emissions. It means that a 1% rise in GDP is a source of a 0.1548% rise in CO2 emissions. TRADE is positively related to CO2 at a 10% statistical level. It implies that a 1% upsurge in TRADE produces 0.0562% of CO2 emissions in the environment. In addition, this study applied the dynamic common correlated effects technique (DCCET) and panel quantile regression to check the robustness of the findings obtained from the DSUR approach. The findings of these robustness tests are consistent with the DSUR technique results (Tables 8 and 9).

Table 7 Results of long-run estimations through DSUR
Table 8 Results of dynamic common correlated effect (DCCE) estimation
Table 9 The result of quantile regression.

DSUR estimation offers long-run estimations of the concerned variables. For causality association (direction) among important variables, we employ panel VECM Granger causality tests proposed by Engle and Granger (1987). The validation of a long-run link indicates the existence of at least one causal association among parameters. For comprehensive policy recommendations, the policymakers must apprehend the nature of the relationship. Empirical results relying on the panel VECM Granger causality test for the panel of 24 developed and developing countries are summarized in Table 10. The negative and significant sign of ECTt-1 outcomes shows that the long-run causality can be identified in the equations of FDI and TRADE. Likewise, in the short run, there exist unidirectional Granger causal associations from CO2 emissions to FDI, EPU to CO2 emissions, EPU to FDI, FDI to EC, FDI to GDP, EC to CO2 emissions, EC to EPU, EC to GDP, EC to TRADE, and GDP to EPU. Furthermore, the results indicate bidirectional causal associations running from Trade to FDI.

Table 10 Results of the long-run and short-run causality analysis

Discussions

In this article, a distinguished panel of 24 developed and developing nations is used to evaluate the relation between EPU, FDI, EC, GDP, TRADE, and CO2 emissions using cross-country data from 2001 to 2019. The null hypothesis of no CSD across individual series is significantly discarded based on the empirical outcomes from the CSD test in the first stage of the investigation. Because of the close economic ties that exist between nations, any disturbance that arises in one of the countries may spread to other nations in the panel. This is in accordance with the findings of Yang et al. (2020b) for developing countries and Mensah et al. (2020) for African countries. The usage of stationary parameters in the estimation process was established in this investigation. In a panel data context, coping with series with no unit root in compliance with Mensah et al. (2019) empirically eliminates the fabrication of faked outcomes. As a result of the CIPS and CADF unit root tests, all of the study variables in the dataset are non-stationary at levels but will become stationary at the first difference.

Furthermore, using both first- and second-generation panel co-integration procedures to investigate the long-term presence of a link between studied variables confirmed that parameters are co-integrated, indicating the persistence of long-run interconnection. This finding suggests that there is long-run stability between EC, GDP, POPg, URB, and OP among African economies of various income levels. Furthermore, the establishment of a long-term relationship between the parameters being studied eliminates the possibility of erroneous outcomes. As a result of the Westerlund-Edgerton panel co-integration test’s stringent handling of CSD and heterogeneity, the result obtained is that co-integration between investigated parameters for the panel employed in the study becomes more realistic and robust.

Furthermore, when it comes to assessing the dynamics of long-term interactions, the key conclusions of the DSUR estimation strategy posit that the EPU has a significant positive impact on CO2 emissions. The finding of EPU is consistent with the outcome of Adedoyin and Zakari (2020). They reported that EPU degrades the environment of the UK in the long run. It specifies that these countries’ full attention is on economic progress, which ultimately raises the region’s demand for energy and high carbon emissions. So, the government and relevant policymakers should introduce some policies regarding uncertainties without affecting the atmosphere. For example, policymakers make strategies regarding firms by arranging extra capitals to procure renewable energy sources, comprising through other ways, such as national and international funds, credits, and financial aids. It will ensure constancy in the industry and carry some flexibility level, which can be attained through disturbances in the economy. Similarly, local financiers are interested in venturing into green energy projects by proposing investments and reducing taxes that depress energy funding.

Further, several studies have reported the negative association between FDI and CO2 (Jiang et al. 2018; Al-Mulali and Tang 2013; Sung et al. 2018) and support our outcomes. FDI has been measured as an active channel to move the latest machinery from one country to another. FDI can generate positive externalities (Shahbaz et al. 2015b). Through innovative equipment transmission and the introduction of executive expertise and output improvements and knowledge spillovers, FDI raises the level of local technology, increases output, and therefore increases the quality of the region (Perkins and Neumayer 2008). The reason for the reduction in CO2 emissions maybe that FDI can help the atmosphere as the international firms bring more clean technology, which could increase production and energy proficiency. Besides, FDI makes more resources and expertise accessible to enhance the atmosphere, helping technological exchange products and energy-efficient equipment. Thus, FDI can support to decline the growth of CO2 emissions in the region. Therefore, countries should continue to introduce international funds keenly, utilize the latest clean machinery carried by foreign firms, and support the collaboration with advanced economies in less-carbon industry. Therefore foreign investment would encourage technical level of the industries and proficiency of source exploitation. It is suggested to reinforce the direction for international funding in production (Ren et al. 2014).

Similarly, EC outcomes are matched with some latest studies (Saud et al. 2019; Shujah-ur-Rahman et al. 2020). Economic progress increases the demand for energy by instigating new industries or increasing existing productions, ultimately causal to a raise CO2 of the country (Wang et al. 2019). Therefore, ecological growth must improve energy efficiency, which is possible through technological improvement. These countries improve their environmental performance by applying carbon-free energy sources, such as wind, solar, and nuclear. The controlling authorities must import green technologies; if they cannot afford to import green technologies, highly energy-intensive products should be outsourced.

Considering GDP and its significant and strong influence on CO2 emissions supports the conclusion of Salahuddin et al. (2018) and Ssali et al. (2019); they indicated a positive relationship between GDP and environmental pollution. As the economy’s progress is strongly related to the energy requirement, so economies utilize higher energy to boost economic development and generate large output, which ultimately increases the CO2 emissions. Therefore, the government’s responsibility is to formulate policies regarding ecological, economic progress goals, more firm rules, and regulations. Like sequestration should be implemented, and the use of eco-technology for production purposes and economic development should be encouraged because eco-technology decreases the level of CO2 emissions and saves live by making the environment healthy. Similarly, the outcomes of TRADE confirm the findings of Wang and Wang (2018); they confirm a significant association between TRADE and the environment’s degradation. Increasing TRADE is responsible for environmental degradation, and decreasing TRADE is good for the atmosphere. A possible justification for this effect of TRADE on the atmosphere could be a substantial dependence on highly polluted (coal-powered) technologies for production, domestic energy consumption, and the several contamination industries situated inside these regions, giving support to the pollution-haven hypothesis of the selected economies.

On the other hand, it is essential that the present study investigates the DSUR technique’s robustness through the dynamic common correlated effects technique (DCCET) and the panel quantile regression. The outcomes of DCCET are consistent with the DSUR technique results. The results of DCCET reveal that EPU, FDI, EC, GDP, and TRADE are statically significant at different levels. These results indicate a positive relationship of EPU, energy consumption, GDP, and trade openness with CO2 emissions, which implies an escalation in these variables, reducing the quality of the environment. However, foreign direct investment indicates an adverse relationship with CO2 emissions, signifying that foreign direct investment increases the environment’s quality. Similarly, lastly, we examined the panel quantile regression estimation at 11 different quantile levels (i.e., 5th, 10th, 20th, 30th, 40th, 50th, 60th, 70th, 80th, 90th, and 95th). The overall results are consistent with the previous finding (i.e., Table 7) and show that EPU has a statistically significant and positive impact on CO2 in all regression models, while FDI has a positive effect on CO2 in the lower quantile, but it will become negative in the middle and upper quantiles. This strengthens the earlier finding and supports the pollution halo hypothesis and shows that as the level of FDI increases, it reduces the adverse impact of the CO2. The rest of the control variables remain consistent.

Conclusion and policy implications

This paper examines the association between EPU, FDI, EC, GDP, TRADE, and CO2 emissions on the panel of 24 developed and emerging economies between 2001 and 2019. We employ second-generation econometric methods to examine stationary, cross-sectional dependency, and co-integration between reliable outcome variables. Additionally, we use DSUR to investigate the long-run relationship and the VECM panel causality approach to endorse causal relationship variables. We also employ the dynamic common correlated effects and quantile regression technique for robustness.

We find that EPU, EC, GDP, and TRADE are harmful to the environment, while FDI enhances the performance of the environment of the sample countries. Empirical results show that a 1% rise in EPU, EC, GDP, and TRADE causes 0.1870, 1.0451, 0.1548, and 0.0562% increase in the degradation of the environment at 1% and 5% statistically significant level. However, a 1% rise in FDI is related to a 0.0048% decrease in CO2 emissions at a 5% statistically significant level. The panel VECM Granger causality test outcomes show that the long-run causality can be identified in the equations of FDI and TRADE. Likewise, in the short run, there exist unidirectional Granger causal associations from CO2 emissions to FDI, EPU to CO2 emissions, EPU to FDI, FDI to EC, FDI to GDP, EC to CO2 emissions, EC to EPU, EC to GDP, EC to TRADE, and GDP to EPU. Furthermore, there exist bidirectional Granger causal associations from Trade to FDI and Trade to FDI.

Policymakers must understand the dynamics of the country in formulating economic policies about energy consumption and CO2 emissions. These strategies must be planned without impeding policy stability, as EPU can cause detrimental environmental issues. Therefore, it is suggested that the governments or policymakers of the sample country’s government must strive to maintain consistency and stability in economic policies, to reduce the adverse effects of economic policy fluctuations in improving the efforts of firms to reduce carbon emissions to maintain the country’s energy consumption structure. Second, the government should provide subsidies or text exemption to domestic and foreign investors in support of R&D and deploy low carbon technologies to convert energy sources into renewable energy, which will help reduce carbon emissions. Third, the government should impose some policies to decrease energy usage and upsurge clean energy resources to deliver wide-ranging assistance to economic affluence, which would mitigate EPU. Relevant strategies would grasp much time to impose, but these countries’ economies are technically progressive, and they have the resources to progress to a clean and green environment. Lastly, the government should be constantly encouraged to reduce fossil fuels and enhance energy intensities.

However, this study provides some new understandings of the linkage between EPU, FDI, EC, GDP, TRADE, and the environment; thus, it has certain limits. This study used a panel of 24 advanced and developing countries. Therefore, future studies should consider a single country to examine the effect of EPU, FDI, EC, GDP, and TRADE on CO2 emissions. It will better understand and provide some new policies regarding improving environmental quality in a particular country.