1 Introduction

The increasing rate of greenhouse gas (GHG) emissions arising from economic and human activities has a detrimental influence on the environment (Adebayo & Kalmaz, 2021). The rate at which effusions are rising and their damaging effects on the ecology have been viewed as the two most important issues in both developed and developing nations. These have led to the signing of many international agreements like the Paris agreement (2015), Copenhagen accord (2009) and Kyoto protocol (1997), and among others. Enshrined in these agreements are guidelines to help reduce GHG emissions and its impacts on the environment. Researchers in their attempt to determine the drivers of environmental pollution reported that financial development (Zeraibi, 2021; Le et al., 2020; Ibrahim & Vo, 2021; Ahmed et al., 2021; Ye et al., 2021), energy consumption (Agbede et al., 2021; Ali et al., 2021; Alola et al., 2021; Nawaz et al., 2021; Shobande & Ogbeifun, 2021), FDI (Bakhsh et al., 2020; Bhujabal et al., 2021; Bulut et al., 2021; Omri & Hadj, 2020; Vo & Ho, 2021), urbanization (Pata, 2018; Sheng et al., 2019; Solarin et al., 2017; Sun et al., 2018), industrialization (Ayitehgiza, 2020; Mahmooda et al., 2020; Rehman et al., 2021; Sarkodie et al., 2020; Yang et al., 2021a, 2021b), remittances (Azam et al., 2021; Jamil et al., 2021; Khan et al., 2021a, 2021b; Usman & Jahanger, 2021; Zhang et al., 2021a, 2021b), fossil fuel and renewable energy consumption (Adebayo, 2022), natural resource intensification, ageing population and globalization (Gyamfi et al., 2022a, 2022b), and financial inclusion (Mehmood, 2021; Fareed et al., 2022; Hussain et al., 2021; Le et al., 2020; Zaidi et al., 2021; Amin et al., 2021) are key promoters of ecological pollution. Among EU countries, however, dirty energy utilization (Rasheed et al., 2021) has been identified as one of the major causes of environmental pollution, accounting for 75% of all man-made GHG emissions in the bloc (Eurostat, 2021). The soaring rate of emissions in the nations signposts that the EU is failing to attain the United Nations’ SDGs. By the close of 2030, the IPCC reports that all countries have to reduce their emissions to 25–30Gt. Otherwise, the temperature in the globe will likely surge by 1.5 °C in the next two decades (Sharma et al., 2021). To attain the above goal, EU member countries should start or intensify their decarbonization process by shifting to alternative energy solutions. Also, governments in various countries have to support energy entities, so that they could obtain finances from the open market to boost green energy generation to help improve EQ. Moreover, the harmful contributions of stock markets to the environment cannot be ignored in the EU’s fight toward carbon neutrality, because the manufacturing and production activities supported by stock markets in the countries can intensify the level of environmental pollution through the utilization of dirty energies. Thus, aside serving as drivers of economic growth, developments at stock markets can also promote ecological pollution and should therefore be factored into the environmental protection decisions of the nations.

Stock market development (SMD) helps to accomplish several of the SDGs of the UN. For example, SDG 1 will be attained if SMD help to improve the living standards of households. Also, SDG 2 will be attained if stock markets help to guarantee food security, improve nutrition, eradicate hunger and promote agriculture that is sustainable. Besides, if stock markets aid in the promotion of health and well-being among people of all ages, SDG 3 will be achieved. Moreover, if developments at the stock markets promote quality education and broadens opportunities for learning, SDG 4 will be attained. Also, SDG 5 will be achieved if stock markets help to advance gender equality and empower women and girls in our society. Additionally, if stock markets help to promote sustainable water and sanitation in economies, the ambition of SDG 6 will be obtained. Moreover, SDG 7 will be accomplished if stock markets promote accessibility to modern and sustainable energy. Also, if stock markets stimulate sustainable economic progress, SDG 8 will be attained. Furthermore, SDG 9 will be accomplished if developments at stock markets support sustainable industrialization and environmentally friendly interventions. Additionally, if stock markets help to fund initiatives that make cities and societies sustainable, SDG 11 will be attained. Also, SDG 12 will be attained if stock markets help to promote consumption and production patterns that are sustainable. Moreover, if stock markets help to fund initiatives that reduce the effects of climate change and its consequences, SDG 13 will be attained. Furthermore, SDG 15 will be accomplished if stock markets help to prevent land pollution, eliminate desertification and protect forests as well as terrestrial ecosystems. Finally, if stock markets contribute to the long-term development of societies that are peaceful and inclusive, SDG 16 will be attained.

Countless studies have explored the connection between stock market development and EQ. The discoveries are, however, contrasting. For example, Zhang et al. (2022) research on the top-carbon emission economies, Mayssa et al. (2021) study on 19 emerging markets, Meza et al. (2021) research on 26 Asian conutries, Goutte et al. (2021) study on emerging markets, and Sharma et al. (2021) research on four South Asian countries affirmed SMD as detrimental to EQ, but Chang et al. (2020) study on 18 countries, Habiba et al. (2021) investigation on G20 countries, Younis et al. (2021) study on emerging nations, Tamazian et al. (2009) study on some selected countries, and Li et al. 2021a; 2021b) research on 25 countries of OECD among others affirmed SMD as friendly to EQ. Irrespective of the countless studies on the association between SMD and EQ, limited studies have been undertaken to study the relationship between the variables in the EU region. Studies conducted on the EU like Radmehr et al. (2021), Rasheed et al. (2021), Horobet et al. (2021), Pejović et al. (2021) and Kasperowicz (2015) addressed the connection amidst other macroeconomic factors and ecological quality, but did not consider the nexus amidst SMD and the ecosystem of the region. Therefore, undertaken this study to help patch that void was well in line. The EU was used as a case for this study, because it is a significant contributor of global pollution, as it releases vast quantities of GHGs and air pollutants into the atmosphere every year. Since the industrial revolution, nations that now form the EU account for roughly 18% of global emissions. A large portion of these historic effusions can be traced back to Germany, France, Italy and Poland, the EU’s four most polluting countries. Also, according to the European Environmental Agency (EEA), the EU member states have a large ecological footprint (EFP), which is now more than double the region’s biocapacity (thus, the ability of ecosystems to provide useful biological resources while also absorbing carbon effluents created by production and consumption systems). Because of the region’s large EFP, the demand for ecological goods and services has surpassed the capacity of its ecosystems. As a result, there is a significant ecological deficit, which has negatively impacted the environment of the region. Moreover, environmental pollution has become a focal point in all current policy debates, due to its devastating consequences on economies, health, and livelihoods. Therefore, undertaken this study to come out with powerful recommendations to boost EQ in the region was deemed appropriate.

Contributively, this is one of the groundbreaking studies undertaken to investigate the connection amidst SMD and ecological quality in the EU after extensive scrutiny of literature. The exploration also improves on earlier works by employing second and third generation econometric techniques that control for heterogeneity, dependencies and structural breaks. Earlier works on the predictors of EQ like Yao and Zhang (2021), Nwani et al. (2021), Doğanlar et al. (2021) and Sheraz et al. (2021) employed conventional econometric methods that could lead to biased estimates and wrong conclusions. Moreover, the study used ecological footprint to proxy for EQ unlike prior explorations that used CO2 emissions, because many countries in the EU are currently finding it difficult to cope with the challenges associated with ecological deficit (Global Footprint Network, 2019). According to Sabir and Gorus (2019), Zafar et al. (2019a, 2019b) and Al-Mulali and Ozturk (2015), CO2 effusions do not fully capture environmental pollution, as it represents only a small portion of the overall environmental scenario. To Ulucak and Apergis (2018), emissions from CO2 do not include stocks in natural resources like forests, oil, soil and mining among others; as such, it is a weak measure of EQ. The Global Footprint Network (GFN) reports the six constituents of EFP as pollution from grazing land, carbon footprint, crop land, fishing grounds, built-up land and forest land. This composition makes the variable a more inclusive measure of EQ than that of CO2 emissions. Therefore, following Nathaniel (2021), Adebayo et al. (2022a; 2022b), Ahmed et al. (2021), Dogan and Shah (2022) and Yang et al. (2021a; 2021b), using EFP as a proxy of EQ was well in line. Unlike prior investigations on the determinants of EQ in the EU that failed to factor model specification bias in their analysis, this study accounted for the above issue by controlling for natural resource rents (NRR), trade openness (TO) and energy consumption (EC). This approach was adopted because the omission of a potential regressor from a model could result in biased coefficients of the included variables leading to wrong deductions or conclusions (Asterious & Hall, 2011; Colegrave & Ruxton, 2017).

This research is significant because it presents an intriguing route for future research by helping researchers to gain a better understanding of the topic of concern. The research is also important because it will assist policymakers in formulating effective environmental policies that will benefit the nations’ ecosystems. Particularly, environmental innovation strategies targeted at lowering emissions, improving energy efficiency and boosting green development (Caporale et al., 2021; Chen & Lee, 2020; Zhang et al., 2017a, 2017b) could add to the nations’ ecological quality. The study was carried out via a well-defined econometric procedure. First, cross-sectional dependence (CD) tests were performed to determine dependencies or otherwise in the residual terms. Afterwards, a homogeneity test was conducted to determine homogeneity or otherwise in the coefficients. Thirdly, tests for stationarity were conducted to determine the stationarity features of the variables. Fourthly, tests to affirm the variables’ cointegration features were performed. At the 5th stage, the coefficients of the regressors were estimated, while the causations amidst the variables were computed at the last phase. This research is original because it is a significant addition to accumulated knowledge within the environmental discipline. The study is also original, because it applies new and robust econometric methods to existing data, it provides additional support for existing interpretations, it discovers new information, it provides powerful solutions to identified issues, and it analyzes a phenomena in a detailed way. Following this introduction section is the review of related literature while the methodology is the focus of the third section. In Sects. 4 and 5, the results and discussions are correspondingly outlined, while the conclusions and policy recommendations are brought to light in Sect. 6.

2 Literature review

The stock market serves as a barometer of a country’s financial well-being. It reflects how investors feel about a country. As a result, stock market development (SMD) is an important part of the growth process of a nation (Tachiwou, 2010). According to the World Bank, growth in the stock markets of economies is inextricably linked to their overall development. To the body, well-functioning stock markets provide good and easily accessible information, which can reduce transaction costs, improve resource allocation and boost economic viability. As indicated by Greenwood and Smith (1997), large stock markets can reduce the cost of mobilizing savings, allowing for investments in the most productive technologies. The nexus amidst other macroeconomic determinants and ecological quality has been studied extensively. For example, Miao et al. (2022) employed the MMQR technique to analyze the association between some selected macroeconomic variables and EQ in newly industrialized countries (NICs). From the results, financial globalization and the consumption of renewable energy mitigated EFP in all quantiles (0.1–0.90); however, natural resources and economic progress escalated EFP in all quantiles (0.1–0.90). Also, Adebayo et al. (2022b) analyzed NICs from to 1990 to 2018. From the estimates, NRR deteriorated the countries’ EQ. However, the moderation between NRR and globalization improved the nations’ ecological quality. Alola et al. (2022) studied the dynamics of EFP in China and disclosed that, growth in the economy promoted EFP in the middle quantile (0.40–0.70). Also, primary energy utilization and fossil fuel spurred EFP in all the quantiles (0.01–0.95). Amazingly, energy from renewable sources escalated EFP in the lower quantiles (0.1–0.40). Adebayo et al. (2022a) researched on Turkey from 1985 to 2019. From the QQR estimates of the exploration, agriculture, urbanization, financial development and economic progress promoted carbon emissions in all quantiles. However, the consumption of renewable energy mitigated carbon effusions in the middle quantile. Kirikkaleli et al. (2021) undertook an investigation at the global level and confirmed clean energy utilization and financial development as positive predictors of ecological sustainability, however, economic growth harmed the ecosystem of the nations of concern.

Despite the countless investigations on the determinants of EQ, little attention has been paid to the nexus amidst SMD and EQ. On the examples of such studies, Zhang et al. (2022) investigated the top-carbon emission economies from 1990 to 2016 and discovered that increased size of stock markets was harmful to EQ. Habiba et al. (2021) explored the SMD and EQ linkage in G20 economies. The study further categorized the countries into developed and developing economies. From the discoveries, SMD index improved EQ in the aggregate panel and the developed economies, but spurred pollution in the developing countries. Su and Deng (2019) employed the panel quantile regression model to study the connection between stock markets and emission allowance price in China. From the discoveries, emission allowance price and domestic stock markets were negatively related. The intensity of the effects diminished as the quantiles surged. Mayssa et al. (2021) investigated 19 emerging markets from 1994 to 2014. From the linear and nonlinear ARDL estimation techniques, both negative and positive changes in stock markets worsened EQ in the economies. Abbasi and Riaz (2016) researched on Pakistan and discovered that, stock markets stimulated emissions in the nation. Li, Ahmad, et al. (2021), Li, Chen, et al. (2021)) researched on 25 OECD countries and found out that if the nations enjoyed high economic expansion, SMD promoted EQ; however, if the nations enjoyed low economic progress, SMD worsened EQ. From a study conducted by Paramati et al. (2018), stock markets minimized EQ in developing economies, but improved ecological quality in developed economies. According to a study by Tamazian et al. (2009), stock markets had a decreasing effect on emissions in some selected countries. Meza et al. (2021) investigated 26 Asian economies and disclosed that positive changes in stock markets worsened EQ; however, negative variations in stock markets advanced the countries’ EQ. The research advocated for the improvement in green financial activities in the Asian stock markets. Zhang et al. (2011) analyzed the connection between stock markets and clean energy utilization in China over the period 1992–2009. From the disclosures, stock markets exerted a moderately highly impact on the country’s emissions.

Chang et al. (2020) studied 18 countries from 1971 to 2017. From the results, a percentage rise in stock returns enhanced EQ by 9%. Besides, a causation from stock returns to pollution in the ecosystem was discovered. Zafar et al. (2019c) analyzed the connexion amidst stock markets and EQ in G-7 and N-11 nations. Based on revelations of the study, stock markets harmed EQ in G-7 nations, but improved EQ in N-11 economies. According to a study conducted by Younis et al. (2021), stock markets in developing economies deteriorated EQ, but the stock markets in emerging economies improved EQ. In Argentina Grand & D’Elia (2005) disclosed that negative environmental news had an influence on stock performance; however, positive news on the environment had no linkage with stock performance. Ulusoy and Demiralay (2017) investigated OECD nations from 1996 to 2011. From the study’s results, stock markets had an impact on EQ via electricity and oil demand. Over the period 1990–2016, Sharma et al. (2021) studied four South Asian economies and revealed that SMD deteriorated EQ in the countries. Also, the interaction between SMD and clean energy, and subsequently between technological advancements trivially influenced EQ. Kutan et al. (2018) studied emerging economies and discovered that, stock markets had a vital influence on the environment. Godil et al. (2020) employed the quantile approach to examine the association between stock markets and EQ in Turkey. From the study’s findings, the rise in stock markets damaged biodiversity in the nation. Nasir et al. (2019) exploration revealed that the rise in listed entities worsened air quality in ASEAN economies. Ullah and Ozturk (2020) researched on Pakistan from 1985 to 2018 and disclosed that positive and negative changes in stock markets had a substantially favorable influence on the country’s emissions. In Malaysia, Al-mulali et al. (2019) assessed the connection between stock markets and EQ and discovered that positive shocks in stock markets weakened the nation’s EQ. Paramati et al. (2016) analyzed 20 emerging countries over the period 1991 to 2012. From the results, developments at the stock markets had a substantially positive effect on clean energy consumption, thereby improving EQ. Aswani et al. (2021) investigated 2729 US entities from 200 to 2019 and discovered that the association between unscaled emissions and stock returns vanished when industry clustering of standard errors, size and vendor-estimated versus firm-disclosed emissions were taken into account. Razmi et al. (2019) studied SMD and two types of REC in Iran and reported that SMD had a long-term effect on REC, and subsequently, EQ in the nation.

Giese et al. (2021) examined how stocks responded to changes in climate policy and disclosed that, after climate-related political or regulatory events, equity markets did not always react in the same way, and stock prices frequently went in the opposite direction of expectations. It was also reported that the prolonged nature of political decision-making procedures could account for some of the lack of consistency. The authors further discovered that more carbon-efficient firms’ outperformance developed steadily over time and surged in the last two years when stock price returns over longer periods were looked at. Al Mamun et al. (2018) investigated OECD countries and found out that, a well-developed and efficient market influenced carbon intensity via technological innovation and renewable energy. According to Brogger (2021), the amount of emissions by publicly traded corporation is approximately twice as much as previously thought, highlighting the importance of shareholder engagement in the battle against global warming. Alam et al. (2020) analyzed the association amidst stock markets and ecological quality in 30 OECD nations. From the discoveries, stock markets degraded EQ in the nations. Danni (2009) investigated the association between climate risk exposure and share performance of some carbon-intensive sectors in the European equity market and discovered some price variations, which might imply a correlation between the two. From the firm-specific regression analysis, a positive connection between share performance and the company’s carbon management performance was disclosed. Abbasi and Riaz (2016) studied Pakistan from 1970 to 2011. From the estimates, stock market had a trivial effect on EQ. Bolton and Kacperczyk (2020) investigated the linkage between US stock returns and carbon emissions and discovered that the stocks of entities with higher emissions got higher returns, when book-to-market, size and other return determinants were controlled for. The study also reported that exclusionary screening based on direct emission intensity was used by institutional investors in few key industries. In et al. (2019) documented an adverse association between stock returns and the exudates of carbon. Yahya et al. (2021) studied the connexion amidst EQ and stock performance in 80 economies from 2006 to 2016 and disclosed that environmental performance surged stock market performance irrespective of the constitutional regime. It was also disclosed that democracy level could mitigate the negative influence of ecological pollution and promote stock market performance in a parliamentary regime. Finally, FDI facilitated the connexion amidst environmental performance and stock performance in a presidential regime. Khan et al. (2016) postulated that firms that reduced their emissions disproportionately could be able to realize more stock returns. Lee and Cho (2021) conducted a study on 841 Korean firms and discovered a substantially positive association between carbon emissions and firm value of chaebol affiliate firms, but an insignificant relationship between the variables in non-chaebol affiliate entities. This implies emissions in chaebol affiliate establishments were not yet value-destructive, but were gainful to the market and investors. Xu et al. (2012) investigated listed corporates in China and disclosed that the average decrease in market value was significantly lower than the predicted changes in market values of similar events in other nations. This implies the stock market was weakly affected by the negative environmental occurrences affecting Chinese listed corporates. Goutte et al. (2021) researched on emerging markets and found that, negative and positive changes in stock markets mitigated EQ via more carbon effusions.

Summarily, prior studies on the linkage between SMD and environmental quality (EQ) yielded conflicting outcomes. For example, Zhang et al. (2022) investigation on the top-carbon emission economies; Mayssa et al. (2021) research on 19 emerging markets; Godil et al. (2020) exploration on Turkey; and Ullah and Ozturk’s (2020) analysis on Pakistan among others, affirmed SMD as detrimental to EQ, while Habiba et al. (2021) study on G20 countries; Meza et al. (2021) study on 26 Asian nations; and Chang et al. (2020) study on 18 countries among others confirmed SMD as beneficial to the ecosystem of nations. The mixed disclosures might be due to variations in the variables employed, geographical locations, study period and the econometric methods engaged among others. This signpost that the debate on the linkage between SMD and EQ is unceasing and demands for further investigations. Therefore, engaging second and third generation econometric techniques (which have been ignored by many previous investigations) that account for structural breaks, cross-sectional dependence and heterogeneity to study the linkage amidst the series in the EU was deemed vital in adding to the aforestated debate.

3 Materials and methods

3.1 Data source and descriptive statistics

Panel data on 17 EU member countries were used for the analysis. Due to data restrictions, the sample period was limited 1995–2014. Data on EFP which were used as a proxy of EQ were sourced from the GFN while that of SMD, NRR, TO and EC were extracted from the database of the World Bank. Following Pata et al. (2022) and Khan et al. (2022), ecological footprint was incorporated as a measure of EQ, while SMD was adopted as a determinant of EQ in line with Zhang et al. (2022) and Habiba et al. (2021). Also, NRR was incorporated as a determinant of ecological quality following Du et al. (2022) and Adebayo et al. (2022), while TO was employed as a determinant of EQ in line with the works of Chisti et al. (2022) and Opula et al. (2022). Finally, EC was used as a predictor of EQ collaborating those of Rahaman et al. (2022) and Chaouachi and Balsalobre-Lorente (2022). The investigated countries and the series’ other facts are presented in Table 1. The variables’ descriptive information is reported in Table 2. In terms of averages, SMD was the largest, while NRR was the lowest. With respect to variability in the dataset, EFP, TO and EC had low standard deviations (SD). This implies, the data points of those series clustered closer to their means. Conversely, SMD and NRR had relatively high SD, signifying that the data points of those variables were spread out further from their means. With respect to skewness, the distributions of EFP, TO and EC were skewed to the right, while those of NRR and SMD were skewed to the left. Also, the kurtosis of all the variables were more than 0. This means the distributions of the variables were heavy tailed. In other words, the variables had leptokurtic shaped distributions. Besides, the VIF, tolerance and the Farrar and Glauber tests found no collinearity amidst the predictors as indicated in Table 3. Also, all the regressors were significantly loaded based on the results of the PCA exhibited in Table 4. This means, the variables could be used in predicting the quality of the bloc’s ecosystem. Finally on the correlations amidst the series, SMD had a significantly negative association with EFP. However, NRR, TO and EC were materially positively related to EFP.

Table 1 Data description and measurement units
Table 2 Descriptive statistics and correlational analysis
Table 3 Multi-collinearity tests results
Table 4 Principal components analysis

3.2 Model specification and theoretical underpinning

Despite the negative implications of pollution in the ecosystem, EQ continue to deteriorate as evidenced by the rising rate of GHG emissions in the globe. As such, many explorations on the predictors of EQ have been undertaken to help improve the situation. However, as much as the researcher is aware, no study has been conducted on the stock market development (SMD) and EQ connection in the EU, while controlling for natural resource rents (NRR), trade openness (TO) and energy consumption (EC) at the same time. This study was therefore conducted to aid seal that void. In attaining the above goal, the ensuing econometric model was formulated for estimation.

$${\text{EFP}}_{it} = \alpha_{0} + \beta_{1} {\text{SMD}}_{it} + \beta_{2} {\text{NRR}}_{it} + \beta_{3} {\text{TO}}_{it} + \beta_{4} {\text{EC}}_{it} + \mu_{it}$$
(1)

where the response variable is EFP and SMD is the actual regressor. Besides, the error term is denoted by \(\mu_{it}\) while the constant term is represented by \(\alpha_{0}\). Finally, t connotes the timeframe while i epitomizes the studied countries. As already stated, NRR, TO and EC were incorporated into the model to control for model specification bias. All the series in Eq. 1 were log-transformed to help reduce heteroscedasticity issues in line with Ali (2021), Nwani et al. (2021) and Musah et al. (2022a; 2022b). The log-linear specification of Eq. 1 therefore became

$$\ln {\text{EFP}}_{it} = \alpha_{0} + \beta_{1} \ln {\text{SMD}}_{it} + \beta_{2} \ln {\text{NRR}}_{it} + \beta_{3} \ln {\text{TO}}_{it} + \beta_{4} \ln {\text{EC}}_{it} + \mu_{it}$$
(2)

where \(\beta_{1} ,\beta_{2} ,\beta_{3} {\text{ and}}\) \(\beta_{4}\) are the parameters of lnSMD, lnNRR, lnTO and lnEC, respectively. All other items in Eq. 2 are already defined under Eq. 1. There is ambiguity in the nexus amidst SMD and EQ. For instance, developments in stock markets help establishments to access funding to acquire energy-intensive equipment to expand their operations leading to more pollution on the environment. Thus, the rise in business activities due to developments in stock markets promotes the consumption of dirty energies that deteriorate the environment. Also, stock markets are considered as indicators of economic growth. Therefore, markets with better activities symbolize viable economic progress, which boosts the confidence of businesses in an economy (Meza et al., 2021). According to Sadorsky (2011), the rise in economic confidence propels establishments in the manufacturing sector to produce more goods and services resulting in increased pollution. Besides, growing stock market activities create a wealth effect by disseminating risks to businesses and consumers which has an ultimate influence on energy and pollution (Meza et al., 2021). Based on aforestated assertions, developments in stock markets were projected to have a positive impact on ecological pollution \(\left( {\beta_{1} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{SMD}}_{it} }} > 0} \right),\) supporting the works of Sharma et al. (2021) and Zhang et al. (2022). Contrastingly, well-developed financial markets could attract green overseas investments, which could help to boost EQ. Also, developments in stock markets could stimulate investments in research and development that could improve ecological quality. Moreover, a sound financial market could stimulate investments in ecologically friendly projects that could improve EQ. By enforcing rigorous restrictions on listed corporations, financial markets can also help to improve energy efficiency, which could boost EQ by lowering carbon effluents (Mayssa et al., 2021). Under these circumstances, the marginal effect of stock markets on environmental pollution was anticipated to be negative \(\left( {\beta_{1} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{SMD}}_{it} }} < 0} \right),\) supporting those of Habiba et al. (2021) and Chang et al. (2020). There is also ambiguity in the association between NRR and EQ. For example, economic growth via industrialization increases demand for natural resource extraction, which affects emission levels. Thus, over exploitation of natural resources diminishes a country’s biocapacity thereby worsening its EQ (Shen et al., 2021). Also, because natural resources are used as primary energy inputs for the generation of power, their combustion could release carbon into the atmosphere (Li et al., 2020a; 2020b; 2020c). Based on the above submissions, NRR was expected to have a detrimental effect on EQ \(\left( {\beta_{2} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{NRR}}_{it} }} > 0} \right),\) collaborating those of Du et al. (2022) and Zuo et al. (2022). Contrarily, natural resources could attract foreign investments that are linked to green and energy-efficient technologies that could boost EQ (Adedoyin et al., 2020; Li et al., 2019). This is in line with the assertion of Shahadi & Feyziand (2016) that natural resources attract foreign direct investment, which improves EQ in highly industrialized countries by incorporating energy-efficient technologies into the production process. Also, rich resources could curb the usage of polluting energies by minimizing their imports (Hassan et al., 2021). This could improve the ecosystems of nations. Under these circumstances, NRR was to have a beneficial effect on EQ \(\left( {\beta_{2} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{NRR}}_{it} }} < 0} \right)\), supporting the works of Altinoz and Dogan (2021) and Zhang et al. (2021a; 2021b). Besides, there is no consensus on the nexus between TO and EQ. For instance, trade liberalization accelerates the free flow of products between countries and increases production, resulting in higher energy utilization and therefore pollution (Shahbaz et al., 2015). Also, in economies where appropriate ecological regulations are not formulated and implemented, the unwanted impacts of trade on the environment cannot be avoided (Teng et al., 2021). Furthermore, if nations trade in high-polluting items, the ecosystems of those nations could be adversely impacted (Su et al., 2021; Yildirim & Yildirim, 2021). Based on these scenarios, TO was expected to worsen ecological quality \(\left( {\beta_{3} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{TO}}_{it} }} > 0} \right),\) supporting those of Chisti et al. (2022) and Byaro et al. (2022). However, according to the technical effect, when the volume of trade improves, it boosts technological innovations, which subsequently improve EQ (Usman et al., 2022). Also, if nations trade in green and environmentally harmless items, the quality of ecosystems could improve (Murshed et al., 2021a; Usman et al., 2021). Under these circumstances, the study predicted trade to be friendly to EQ \(\left( {\beta_{3} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{TO}}_{it} }} < 0} \right),\) collaborating the works of Khan et al. (2021a; 2021b) and Karedla et al. (2021). There is finally ambiguity in the affiliation between EC and EQ. For instance, most energies used to stimulate economic activities are generated from sources like fossil fuels, municipal and industrial wastes, and materials from plants. The consumption of energies from these sources negatively influences the environment due to their linkage with byproducts like CO2, SO2, NOx, CO and mercury among others. Under this instance, the coefficient of EC was expected to be positive \(\left( {\beta_{4} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{EC}}_{it} }} > 0} \right)\), supporting those of Elfaki et al. (2022) and Haq et al. (2022). Contrastingly, when there is efficient use of energy, the amount of greenhouse gases and other air pollutants emitted are reduced thereby boosting EQ. Also, some energies used to execute economic activities are generated from clean sources like wind, solar, hydro and biomass among others. The consumption of energies from these sources could improve the ecosystem of nations. Under these scenarios, EC was projected to be beneficial to ecological quality \(\left( {\beta_{4} = \frac{{\partial \ln {\text{EFP}}_{it} }}{{\partial \ln {\text{EC}}_{it} }} < 0} \right)\), supporting the works of Awan et al. (2022) and Amin et al. (2022).

3.3 Econometric strategy

Due to unobserved components and common shocks among others, correlation in cross-sectional units might arise (Murshed & Dao, 2020; Shen et al., 2021). According to Murshed (2021) and Xue et al. (2021), failure to deal with dependencies in regression analysis could result in skewed and incorrect conclusions. Therefore, as a first step, the Pesaran (2004) scaled LM test, the biased adjusted LM test (Pesaran et al., 2008), Breusch and Pagan (1980) LM test and the Pesaran (2004) CD test were engaged to check for dependencies in the residual terms. Also, since the investigated nations vary in macroeconomic aggregates like EFP, SMD, NRR, TO and EC among others, the slope coefficients could also vary. It was therefore pertinent to check for heterogeneity or otherwise in the slope parameters, since failure in doing so could result in erroneous estimations and conclusions (Shen et al., 2021; Xue et al., 2021). Hence, following Liu et al. (2021) and Ma et al. (2021), the test of Pesaran and Yamagata (2008) was used to observe heterogeneity or otherwise in the coefficients. Moreover, the conventionally used first-generation unit root tests like the IPS, LLC, Fisher-ADF and the PP-Fisher among others do not account for heterogeneity, CD and structural break in cross-sectional units. Hence, the CIPS and the CADF tests of Pesaran (2007) were first engaged to examine the variables’ stationarity features. The above second generation tests are robust to CD and heterogeneity but not structural break issues (Nathaniel et al., 2021; Xue et al., 2021). However, since the studied countries have witnessed major economic shocks like the global financial crises, it was fitting to account for structural breaks in the unit root analysis. Therefore, the test of Bai and Carrion-i-Silvestre (2009) was also engaged to assess the stationarity features of the series. Apart from overcoming heterogeneity and CD issues, this test also controls for structural breaks in its analysis (Bai & Ng, 2004; Liu et al., 2021; Xue et al., 2021).

Just like the conventional tests for stationarity, conventional conitegration tests like the Larsson et al. (2001), Kao et al. (1999) and the McCoskey and Kao (1998) tests do not control for structural breaks, CD and heterogeneity break concerns (Liu et al., 2021). Therefore, in line with Shen et al. (2021), the Banerjee and Carrion-i-Silvestre (2017) and the Westerlund and Edgerton (2008) tests that control for the above issues were employed to assess the cointegration properties of the series. Also, in models with heterogeneity and cross-sectional correlations, the application of conventional regression estimators like the GMM, fixed effects (FE) and the random effects (RE) that assume homogeneity in slope parameters would be invalid (Chudik et al., 2017), because there are country-specific characteristics that might make slope parameters to heterogeneous. Therefore, at the fifth stage, the CS-ARDL technique which is vigorous to heterogeneity and CD was engaged to estimate the elasticities of the predictors. Aside handling the above concerns, this estimator is also advantageous, because it can estimate both long-run and short-run coefficients of regressors, and further controls for endogeneity, non-stationarity and omitted variable bias issues (Bindi, 2018; Chudik et al., 2017). The ensuing CS-ARDL specification was developed to explore the elasticities of the predictors:

$$\begin{aligned} \ln {\text{EFP}}_{it} = & w_{i} + \mathop \sum \limits_{j = 1}^{{p_{y} }} \lambda_{ij} \ln {\text{EFP}}_{it - j} + \mathop \sum \limits_{j = 0}^{{p_{x} }} \beta_{1j} \ln {\text{SMD}}_{it - j} + \mathop \sum \limits_{j = 0}^{{p_{x} }} \beta_{2j} \ln {\text{NRR}}_{it - j} + \mathop \sum \limits_{j = 0}^{{p_{x} }} \beta_{3j} \ln {\text{TO}}_{it - j} + \mathop \sum \limits_{j = 0}^{{p_{x} }} \beta_{4j} \ln {\text{EC}}_{it - j} \\ & + \mathop \sum \limits_{j = 0}^{p} \gamma_{1j} \overline{{\ln {\text{EFP}}}}_{t - j} + \mathop \sum \limits_{j = 0}^{p} \gamma_{2j} \overline{{\ln {\text{SMD}}}}_{t - j} + \mathop \sum \limits_{j = 0}^{p} \gamma_{3j} \overline{{\ln {\text{NRR}}}}_{t - j} \\ & + \mathop \sum \limits_{j = 0}^{p} \gamma_{4j} \overline{{\ln {\text{TO}}}}_{t - j} + \mathop \sum \limits_{j = 0}^{p} \gamma_{5j} \overline{{\ln {\text{EC}}}}_{t - j} + \varepsilon_{it} \\ \end{aligned}$$
(3)

where \(\overline{{{\text{lnEFP}}}}\), \({\text{ln}}\overline{{{\text{SMD}}}}\), \(\overline{{\ln {\text{NRR}}}}\), \(\overline{{\ln {\text{TO}}}}\) and \(\overline{{\ln {\text{EC}} }}\) represent the averages of the cross-sections of the regressand and the regressors, respectively. For robustness purpose, the estimates from the CAEC and the CS-DL techniques were also explored. The CS-DL technique is not sensitive to lag length selection like the CS-ARDL approach (Herzer et al., 2017), because it depends on a DL representation. Besides, the estimator can directly estimate the long-run parameters of predictors and also controls for serial correlation, heterogeneity and CD among others (Chudik & Pesaran, 2015; Chudik et al., 2016, 2017). The following CS-DL specification was formulated to compute the coefficients of the predictors:

$$\ln {\text{EFP}}_{it} = w_{i} + \theta_{i} x_{it} + \mathop \sum \limits_{j = 1}^{{p_{x - 1} }} \delta_{it}^{^{\prime}} \Delta x_{it - j} + \mathop \sum \limits_{j = 1}^{{p_{{\overline{y}}} }} \gamma_{yi,j} \overline{y}_{it - j} + \mathop \sum \limits_{j = 1}^{{p_{{\overline{x}}} }} \gamma_{x,it}^{^{\prime}} \overline{x}_{it - j} + u_{it}$$
(4)

where \(\overline{y}\) and \(\overline{x}\) denote the averages of the cross sections of the regressand and the regressors, respectively. The CAEC estimator is also robust to CD and heterogeneity issues. In this method, error correction models are supplemented with cross-sectional averages of all series to eliminate the impact of unobserved common factors (Korbinian, 2017). In line with Ditzen (2019), the CAEC model of the study was specified as:

$$\Delta \ln {\text{EFP}}_{it} = \varphi_{i} \left[ {\ln {\text{EFP}}_{it - j} - \theta_{i} x_{it} } \right] + \mathop \sum \limits_{j = 1}^{{p_{y} - 1}} \lambda_{ij}^{*} \Delta \ln {\text{EFP}}_{it - j} + \mathop \sum \limits_{j = 0}^{{p_{x} - 1}} \beta_{ij}^{{*^{\prime}}} \Delta x_{it - j} + \mathop \sum \limits_{j = 0}^{{p_{T} }} \gamma_{ij}^{^{\prime}} \overline{Z}_{it} + w_{i} + u_{it}$$
(5)

where \(\varphi_{i} = - \left( {1 - \mathop \sum \limits_{j = 1}^{{p_{y} }} \lambda_{ij} } \right)\), \(\theta_{i} = \frac{{\mathop \sum \nolimits_{j = 0}^{{p_{x} }} \beta_{ij} }}{{1 - \mathop \sum \nolimits_{j}^{{p_{y} }} \lambda_{ij} }}\), \(\lambda_{ij}^{*} = - \mathop \sum \limits_{m = j + 1}^{{p_{y} }} \lambda_{im} , j = 1,2, \ldots , p_{y} - 1\), \(\beta_{ij}^{*} = - \mathop \sum \limits_{m = j + 1}^{{p_{x} }} \beta_{im} , j = 1, 2, \ldots , p_{x} - 1.\)

Finally, first-generation causality tests like the Engle and Granger (1987) test among others assume slope coefficients to be homogeneous and do not account for heterogeneity and residual CD in panel regression analysis. This implies applying those tests for heterogeneous and cross-sectionally dependent panels will be inappropriate. Hence, the Dumitrescu and Hurlin (2012) test which controls for the above issues was employed to examine the causations amidst the variables. This test is officially expressed as:

$$Y_{it} = \gamma_{i} + \mathop \sum \limits_{m = 1}^{M} \alpha_{i}^{\left( m \right)} Y_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{i}^{\left( m \right)} X_{it - m} + \varepsilon_{it}$$
(6)

In the above equation, M is the lag orders, while \(\gamma_{i}\) represents the constant term. Also, \(\delta_{i}^{\left( m \right)}\) is the regression parameter, while the autoregressive parameter is epitomized by \(\alpha_{i}^{\left( m \right)}\). With reference to Eq. 6, the following models were developed to determine the paths of causalities amidst the variables.

$$\ln {\text{EFP}}_{it} = \gamma_{1} + \mathop \sum \limits_{m = 1}^{M} \alpha_{1}^{\left( m \right)} \ln {\text{EFP}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{1}^{\left( m \right)} \ln {\text{SMD}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{2}^{\left( m \right)} \ln {\text{NRR}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{3}^{\left( m \right)} \ln {\text{TO}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{4}^{\left( m \right)} \ln {\text{EC}}_{it - m} + \varepsilon_{it}$$
(7)
$$\ln {\text{SMD}}_{it} = \gamma_{2} + \mathop \sum \limits_{m = 1}^{M} \alpha_{2}^{\left( m \right)} \ln {\text{SMD}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{5}^{\left( m \right)} \ln {\text{NRR}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{6}^{\left( m \right)} \ln {\text{TO}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{7}^{\left( m \right)} \ln {\text{EC}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{8}^{\left( m \right)} \ln {\text{EFP}}_{it - m} + \varepsilon_{it}$$
(8)
$$\ln {\text{NRR}}_{it} = \gamma_{3} + \mathop \sum \limits_{m = 1}^{M} \alpha_{3}^{\left( m \right)} \ln {\text{NRR}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{9}^{\left( m \right)} \ln {\text{TO}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{10}^{\left( m \right)} \ln {\text{EC}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{11}^{\left( m \right)} \ln {\text{EFP}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{12}^{\left( m \right)} \ln {\text{SMD}}_{it - m} + \varepsilon_{it}$$
(9)
$$\ln {\text{TO}}_{it} = \gamma_{4} + \mathop \sum \limits_{m = 1}^{M} \alpha_{4}^{\left( m \right)} \ln {\text{TO}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{13}^{\left( m \right)} \ln {\text{EC}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{14}^{\left( m \right)} \ln {\text{EFP}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{15}^{\left( m \right)} \ln {\text{SMD}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{16}^{\left( m \right)} \ln {\text{NRR}}_{it - m} + \varepsilon_{it}$$
(10)
$$\ln {\text{EC}}_{it} = \gamma_{5} + \mathop \sum \limits_{m = 1}^{M} \alpha_{5}^{\left( m \right)} \ln {\text{EC}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{17}^{\left( m \right)} \ln {\text{EFP}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{18}^{\left( m \right)} \ln {\text{SMD}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{19}^{\left( m \right)} \ln {\text{NRR}}_{it - m} + \mathop \sum \limits_{m = 1}^{M} \delta_{20}^{\left( m \right)} \ln {\text{TO}}_{it - m} + \varepsilon_{it}$$
(11)

where \(\delta_{1} , \ldots , \delta_{20}\) are the regression coefficients, while \(\gamma_{1} , \ldots , \gamma_{5}\) are the constant terms. Finally, \(\alpha_{1} , \ldots , \alpha_{5}\) represent the autoregressive coefficients. This test consists of the W-statistic and the Z-statistic and it is specified as:

$$W_{N,T}^{{{\text{HNC}}}} = N^{ - 1} \mathop \sum \limits_{i = 1}^{N} W_{i,t}$$
(12)
$$Z_{N,T}^{{{\text{HNC}}}} = \frac{{\frac{1}{\sqrt N }\left[ {\mathop \sum \nolimits_{i = 1}^{N} W_{i,t} - \mathop \sum \nolimits_{i = 1}^{N} E\left( {W_{i,t} } \right)} \right]}}{{\sqrt {\frac{1}{N}\mathop \sum \nolimits_{i = 1}^{N} {\text{Var}}\left( {W_{i,t} } \right)} }}$$
(13)

In the above equations, \(W_{i,t}\) is the Wald statistic with \(E\left( {W_{i,t} } \right)\) and \({\text{Var}}\left( {W_{i,t} } \right)\) being its expectation and variance correspondingly. The D-H causality test is governed by a null and an alternative hypotheses stated as:

$$\begin{gathered} H_{0} = \beta_{i} = 0\quad \forall_{i} = 1, \ldots ,N_{1} \hfill \\ H_{1} = \beta_{i} = 0\quad \forall_{i} = 1, \ldots ,N\quad 0 \le N_{1} /N < 1 \hfill \\ H_{1} = \beta_{i} \ne 0\quad \forall_{i} = 1, \ldots ,N + 1,N + 2, \ldots ,N \hfill \\ \end{gathered}$$
(14)

From the aforestated hypothesis, if X fails to cause Y, then the null hypothesis of non-causality will be accepted. In contrast, the hypothesis will be rejected if X exerts a causality on Y.

4 Preliminary results

4.1 Cross-sectional dependence and heterogeneity analysis

Dependencies in cross sections (CD) are a fundamental issue in regression analysis. Ignoring CD in regression analysis could result in skewed and inconsistent estimates, which could lead to erroneous conclusions. Therefore, the CD tests exhibited in Table 5 were performed at the first stage. Based on the findings, there were dependencies in the panel under consideration supporting the studies of Musah et al. (2022a), Ma et al. (2021) and Musah et al. (2021a, 2021b). This means a shock in one country could have an impact on the others. This is unsurprising given that EU countries have comparable policies and are linked in terms of geography, culture and trade among others. Aside the CD tests, it was pertinent to check for heterogeneity, because there could be variations in the slope parameters. Therefore, as a second step, the homogeneity test exhibited in Table 5 was performed. Based on the discoveries, the slope coefficients were embedded with heterogeneity aligning the studies of Shen et al. (2021), Musah et al. (2020a, 2020b, 2020c) and Li et al. (2021a, 2021b). This finding is justifiable since the studied countries varied in microeconomic variables like EFP, NRR, stocks traded, EC and TO among others. Heterogeneity and CD tests are essential, because they guide the choice of econometric methods for unit root, cointegration, regression and causality analysis.

Table 5 Cross-sectional dependence and heterogeneity tests results

4.2 Panel unit root and cointegration analysis

At the third phase, the variables’ integration features were investigated via the tests for stationarity illustrated in Table 6. Based on the results, the hypothesis that the variables were nonstationary could not be validated, thus confirming the series to be stationary. This implies shifts in time had no effect on the distributions of the series (Gagniuc, 2017). Though TO was stationary at both levels and first difference under the CIPS and the CADF tests, the Bai & Carron-i-Silvestre (2009) test disclosed a common integration order for the variable. Because this test is more vigorous to structural breaks, heterogeneity and CD (Xue et al., 2021), we preferred its integration order to that of the CADF and CIPS tests. The variables integration properties validate the works of Musah et al. (2022), Liu et al. (2021), Li et al. (2021), Musah et al. (2021b; 2021c) and Sun et al. (2021). The series being stationary implies, they might possess a long-term affiliation. Hence, the tests exhibited in Table 7 were performed to confirm the series’ cointegration features. Based on the results, the variables were cointegrated in the long-run. This suggests that EFP, SMD, NRR, TO and EC had a long-term connection in the EU. Studies by Andrew et al. (2021), Musah et al. (2022b), Phale et al. (2021), Chen et al. (2022), Shi-Zheng et al. (2021) and Li et al. (2020a; 2020b) align the above findings. The affirmation of cointegration amidst the series served as a pre-requisite for the elasticities of the predictors to be estimated.

Table 6 Unit root tests results
Table 7 Cointegration tests results

5 Main results and discussions

It is worth reporting and discussing the study’s findings to help raise policy options that could promote the sustainable development agenda of the EU. Specifically, this exploration adds to literature by focusing on the environmental aspect of the region’s sustainable development rather than economic growth, as other studies have done. The application of the CS-ARDL technique to explore the elasticities of the predictors yielded some interesting results. Firstly, developments in stock markets improved EQ in the EU as a percentage rise in the variable mitigated EFP by 4.312%. This generally implies SMD was not detrimental to the ecosystem of the region. It can be inferred that, stock markets while offering support to establishments took into consideration the environmental concerns of the region. Thus, the stock markets offered support to listed entities that engaged in ecologically harmless operations. Because most EU countries have had sustainable economic progress, they are perceived as lucrative investment locations. This perception has stimulated investments in stock market activities. With the surge in these investments, entities that add to ecological quality also expand tremendously. In such a situation, stock markets could improve EQ in the region. It can further be inferred that stock markets promoted the adoption of technologies that were environmentally friendly. The finding also implies stock markets contributed to the funding of clean and renewable energy projects that helped to boost the region’s ecosystem. This point aligns Paramati et al. (2018) and Kutan et al. (2017) assertions that stock markets provide greater funding for renewable energy projects, resulting in reduced effusions. However, by providing timely financial resources, stock markets may help enterprises to expand their production scale and enjoy economies of scale. This could increase the usage of dirty energies and as a result increase pollution in the ecosystem. The governments should therefore intensify their regulations on stock markets to help advance EQ in the region. The study’s discovery is further justified by the fact that several EU member countries have strict legislations that encourage publicly traded companies to engage in energy efficient and ecologically harmless activities. It can therefore be concluded from the finding that SMD was beneficial to the ecosystem of the EU, as it helped to widen the scope of clean energy solutions, leading to ecological quality improvements. In other words, developments in stock markets did not intensify the usage of conventional energy solutions which could have escalated the rate of pollution in the region. To improve the sustainable contributions of stock markets, nations in the EU should channel more investments in projects and techniques that are ecologically harmless. Also, industries that are linked to clean energy technologies should be listed on the stock markets of the region. Besides, already listed entities that are dependent on fossil fuel technologies should be guided to migrate to green energy technologies. Mayssa et al. (2021) research on 19 emerging markets and Chang et al. (2020) investigation on 18 countries also disclosed a negative association between SMD and ecological pollution and are therefore in tandem with the study’s discovery. However, Sharma et al. (2021) research on South Asian countries and Meza et al. (2021) exploration on 26 Asian economies deviate from the finding of the study.

Moreover, NRR positively affected EFP in the EU. Specifically, a percentage rise in NRR increased EFP by 3.241%. One explanation for this finding is that EU countries put a lot of pressure on natural resources to meet their energy demands (which are subjugated by dangerous polluted fuels), resulting in increased environmental contamination. Because most EU economies are growing rapidly as a result of increased industrial activities, there has been an over-reliance on the region’s natural resources, which has increased pollution levels across the bloc. This means reducing natural resource depletion could improve the ecosystem of the region. Therefore, policies that could regulate the over-extraction of natural resources while boosting ecological quality in the region should be formulated and implemented. Also, resource extracting entities that are energy efficient, technologically reliant and embrace green energy in their operations should be rewarded, while their counterparts on the opposite direction should be reprimanded. Following Ahmad et al. (2020), economies in the EU that are resource abundant should minimize their over-dependence on polluting energies, by shifting to the consumption of green energies. With reference to the finding, the researcher concludes that, NRR was harmful to the ecology of nations in the EU. Adebayo et al. (2022b) research on newly industrialized economies, Ullah et al. (2021) investigation on the top 15 REC economies and Anh Tu et al. (2021) study on BRI member states offer support to the aforestated discovery. However, Adedoyin et al. (2020) research on BRICS economies and Tufail et al. (2021) exploration on developed nations deviate from the study’s disclosure. Likewise, TO had a significantly positive effect on EFP in the EU. Specifically, a 1% rise in trade harmed EQ by 0.657%. This is a testimony that countries in the EU intensified pollution in their ecosystems via trade channels. The finding also suggests that trade between the nations were not related to activities that could benefit the bloc’s ecology. Besides, there were no appropriate policies in place to regulate trading activities across the nations to promote EQ. The finding further implies the countries did not gain from the composition, scale and technique effects. The nations could export more commodities due to the scale effect, generating enough income to go in for ecologically harmless technologies (technique effect). On the other hand, the composition effect could allow the countries to specialize in producing items that generated less pollution (Dada et al., 2022). Moreover, while diversified trade might have contributed to increasing the level of production in the region, it is also possible that it might have increased the demand for energy solutions, resulting in more ecological pollution. However, if trade products were produced using sophisticated manufacturing techniques and less-polluting energy solutions, the increase in trade of such products could contribute to economic viability without damaging the region’s ecosystem. Trade is undeniably important in bolstering economic positions in the global stage. However, it appears that trade promotion activities in the EU are carried out without taking environmental concerns into account. If countries in the region are to meet the SDGs by 2030, the above point should be considered in the policy formulations of the respective governments. Based on the finding, the researcher concludes that, openness to trade worsened EQ in the EU. This supports the studies of Kurramovich et al. (2022), Musah (2022a), Altinoz and Dogan (2021) and Li et al (2021a; 2021b), but deviates from that of Usman et al. (2021) and Szymczyk et al. (2021).

Similarly, EC had a substantially positive impact on EFP in the EU. Specifically, a 1% rise in EC escalated EFP by 2.122%. This suggests that economic activities in the EU were heavily reliant on polluting energies, which worsened EQ in the region. Put simply, driving economic development via energies from dirty sources reduced EQ in the countries. The discovery also implies the countries’ share of renewables in the total energy mix was relatively low, contributing minimally toward ecological sustainability in the region. Therefore, the nations should channel more resources into green energy generation to help improve EQ in the bloc. It has also been reported that allocating funding to the energy sector might help countries become more self-sufficient by lowering dependency on foreign energy imports and boosting reliance on domestic energy output with minimal effusions (Ahmed et al., 2020; Gyamfi et al., 2022a, 2022b). Governments in the EU can adopt the above strategy to help improve the ecosystem of their economies. Based on the finding, the researcher concludes that energy utilization was not friendly to the ecology of EU member states. This aligns that of Li et al. (2022a), Baydoun and Aga (2021) and Rahman and Vu (2021), but conflicts that of Ponce and Khan (2021) and Murshed et al. (2021a).

Also, the ECT was significantly negative with a value of − 0.88. This means the adjustment speed toward the equilibrium association was 88% aligning that of Murshed et al. (2021a) and Zia et al. (2021). On the post-estimation statistics, the R-squared value of 0.89 indicates that the regressors accounted for 89% of variations in EFP. Moreover, the value of the F-statistic being significant implies, the proposed association between the regressors and the regressand was substantially reliable and could be used for predictions. Also, the RMSE value of 0.02 indicates that, the model absolutely fitted the data points. Finally, the hypothesis of no CD in the residuals could not be rejected. This implies the issue of residual CD has been solved after engaging a technique which is vigorous to dependencies. For robustness purpose, estimates from the CAEC and CS-DL techniques were also computed. As indicated in Table 8, the parameters with respect to sign under the two approaches were similar to those under the CS-ARDL estimator. Specifically, SMD had a substantially negative effect on EFP, however, NRR, TO and EC were significantly positively related to EFP. Besides, post-estimation tests like the CD and RMSE under the two approaches collaborate that of the principal estimator. Uniformity in the results of the three methods implies, the findings are valid and reliable. Finally on the causalities amidst the series displayed in Table 9, SMD and EFP were not causally related. This connotes that the two variables were not reliant on each other. An exploration by Mayssa et al. (2021) conflicts the above discovery, but that of Alam et al. (2020) agree with the disclosure of the study. Also, a two-way causation amidst NRR and EFP was observed. This infers that the variables were mutually dependent validating that of Hassan et al. (2021). Besides, a causality from trade to EFP was disclosed. This implies, trade promoted EFP in the region, but not the opposite. As nations strive to attain economic progress, they try to increase international relations via trade. However, because the rise in trading activities are intimately related to expansion in industrial activities, they will have an impact on EQ. Thus, increased industrial activities spurred by increased trade will degrade ecological quality. Investigations by Musah et al. (2021b) and Szymczyk et al. (2021) are conflicting to this finding, but those by Fan and Hossain (2018) and Ansari et al. (2020) agree with the aforestated disclosure. Finally, a feedback causation amidst EC and EFP was discovered. This means the two variables were bilaterally related such that a rise or fall in one variable led to a rise or fall in the other variable. Researches by Musah et al. (2021a) and Li et al. (2020b) are not consistent with this finding, but those by Li et al. (2022b), Shaohui and Tian (2020) and Ozopolat (2021) support the aforestated outcome.

Table 8 CS-ARDL, CS-DL and CAEC estimation results
Table 9 Pairwise Dumitrescu Hurlin panel causality tests results

6 Conclusions and policy recommendations

This study differs from prior explorations in environmental literature as it analyzed the stock market development and environmental quality connection in 17 EU member countries, while controlling for natural resource rents, trade openness and energy consumption at the same time. In attaining this goal, modern econometric methods were engaged. From the results, there was heterogeneity and cross-sectional correlations in the investigated panel. Also, the series were stationary and possessed a long-run cointegration affiliation. On the elasticities of the determinants, developments at the stock markets enhanced environmental quality in the EU. Besides, natural resource rents worsened ecological quality in the nations. Also, trade openness and energy utilization promoted environmental pollution in the countries. On the causalities between the variables, stock market development and ecological pollution were not causally related. But bilateral causalities between natural resource rents and environmental degradation and between energy utilization and ecological pollution were unfolded. Finally, a causation from trade openness to ecological pollution was disclosed. From the above discovery, the study concludes that stock market development enhanced environmental quality in the studied countries; however, the consumption of energy, natural resource rents and openness to trade were harmful to the nations’ ecosystem.

Since stock market development enhanced environmental quality in the EU, it is recommended that policy makers should implement and instruct all listed entities to adopt greener technologies to help reduce pollution in the nations. Stock markets according to Paramati et al. (2017) could decrease ecological quality due to institutional inefficiencies, the existence of traditional activities of production and the paucity of renewable and clean energy availability. Therefore, following Paramati et al. (2017), it is necessary for the countries to implement effective policies in order to build strong institutional structures that will support the generation of renewable energy. Also, the nations should provide incentives to the firms to help them adopt technologies that could minimize pollution in their environment. According to Mayssa et al. (2021), stock markets can supply capital to economies, but they can also have negative impact on ecological quality if environmental standards are not adequately enforced. Therefore, the countries should implement stock market policies that enforce compliance with environmental regulations. Further growth in stock markets, in terms of size and efficiency, has been suggested as a means of improving environmental quality across countries (Paramati et al., 2017). Therefore, stock markets in the EU should institute effective measures to propel listed establishments to engage in environmentally harmless activities.

Moreover, natural resources rents promoted pollution in the EU. Therefore, policy makers should enact regulations to promote sustainable natural resource use in the nations. Also, the resources of the economies should be efficiently used to help promote sustainable development in the bloc. In line with Zhang et al. (2021a; 2021b), governments in the EU should set goals for natural resource protection by leveraging human capital capacities. This goal could be attained by enrolling more individuals into schools to attain the necessary knowledge, skills and experience needed in that sector. This educated personnel will help to adopt advanced technologies related to the production of natural resources, thereby boosting ecological quality. Besides, authorities should educate the populace about the consequences of natural resource overexploitation to help advance the countries’ ecological quality. Following Zhang et al. (2021a; 2021b), policy makers in the nations should formulate policies to balance the demand and supply of resources to help stimulate ecological quality. Trade openness also worsened environmental pollution in the countries. Therefore, regulations that will ensure environmentally friendly trading activities between the nations should be enforced. In other words, measures that will prevent the countries for being used as damping grounds of dirty goods should be initiated. Also, trading activities that are linked to eco-friendly technologies and the utilization of clean energies should be promoted by the nations. Further, trading transactions that promote skills and expertise, energy efficiency, and investments in research and developments that enhance ecological quality should be embraced by the nations.

Finally, energy utilization harmed environmental quality in the EU. Therefore, policy makers should reform the energy policies of the nations to boost the utilization of green energy and other energy-efficient technologies. Also, more resources should be channeled into research and development that will promote green energy generation and utilization in the nations. Moreover, the governments should encourage investors to invest in the clean energy sector. The best way of attaining this objective is to lower the duties or taxes on the importation of clean energy generation materials. Lastly, authorities should reduce the tax burden of entities that use green energy in their production processes, while increasing the tax burden of those that use dirty energies resulting in environmental pollution. This will propel the high polluting firms to transition to the use of clean energies.

Just like other explorations, this study also had some limitations. First, due to data restrictions, the research was limited to 1995–2014. Therefore, comparable studies could be undertaken in future to test the vigorousness of the study’s findings when data covering longer periods become available. Also, the study examined the stock market development and environmental quality connection in only 17 EU member countries. The findings can therefore not be generalized for the entire member states of the EU. Moreover, only the CS-ARDL, CAEC and the CS-DL techniques were used for the parameter estimations. For results comparison purpose, future studies should use alternative econometric techniques to analyze the nexus amidst the same series. Finally, an exploration on the nexus amidst SMD and ecological quality in the African region could be of help to policymakers and the academic community.