1 Introduction

Energy sector causes 75% of the global greenhouse gas (GHG) emissions (International Energy Association 2015). Because of continuous rise in the global energy demand, carbon dioxide (CO2) emissions have significantly increased over the years, which have severe implications for the environment and a significant contributor to global climate change. GHG emissions like CO2 are seen as the driving factor for climate change, which happens due to internal changes within the climate system, or in the interaction between its components, or due to changes in external forces brought about by either human activities or natural factors (Udeagha and Ngepah, 2019, 2020, 2021). The notion that environmental degradation poses a threat to only the industrialised countries and not the less developed countries is no longer valid today at least in terms of consequences (Zhang et al. 2021; Zhao et al. 2021; Zheng et al. 2021; Shahbaz et al. 2013c). The accumulation of GHG emissions in the surface of the earth is significantly affecting every nation across the world, both industrialised and less developed, notwithstanding the country who is responsible for such emissions. The tsunami in Japan, the earthquake in Haiti, the outburst of flood in Australia and Pakistan and the burn out of fire in Russia are just few major disasters witnessed in the recent past that could be attributed to the repercussions of environmental degradation (Haldar and Sethi 2021; Hao et al. 2021; Zerbo 2017). Such events brought about destructions to infrastructure, natural resources like agricultural land and produce, wildlife, forests, and most importantly to precious human lives (Udeagha and Ngepah 2020).

Environmental degradation is now a global issue since every nation is exposed to such threats. The responsibility to save the world from such threats is largely dependent on nations like China, India, Russia, Brazil, OECD group and USA, who are considered the key GHG emitters (Huang et al. 2021; Huo et al. 2021; Islam et al. 2021; Jian et al. 2021; Shahbaz et al. 2013c). More importantly, the successful international efforts to minimise the global CO2 emissions is substantially dependent on the commitment of these key emitters. However, problems begin for countries because CO2 emissions are connected to energy consumption and energy is crucial for economic growth. In this situation, reducing CO2 emissions would certainly reduce production, which in turn retards economic growth, thereby making these countries very reluctant to either comply or commit to programmes to minimise these emissions. Therefore, this calls for finding better approaches in which sustainable economic growth along with improved environmental quality could be attained. Therefore, changing the conventional energy consumption structure and increasing the proportion of renewable energy consumption to substantially reduce energy consumption and improve energy efficiency is thus recognised as among strategies which a country like South Africa could deploy to improve environmental quality and achieve sustainable economic growth.

In an effort to address the increasing concerns about climate change, the Conference of Parties (COP) of the United Nations Framework Convention for Climate Change (UNFCCC) agreed to limit the increase in the global temperature to 2 °C above pre-industrial levels by 2020 in 2015 (UNFCCC 2015). Since this target cannot be achieved until the pattern of energy consumption is changed, therefore, combating climate change with sustainable development has become an essential global agenda in planning for energy production and consumption. An economy may turn to a sustainable track if it uses a mixture of renewable and non-renewable energy resources (Doğanlar et al. 2021; Hongxing et al. 2021; Hu et al. 2021). Thus, policymakers must know the individual contributions of energy sources (renewable and non-renewable) on economic growth and CO2 emissions. Meanwhile, the environmental and economic gains of renewable energy are well-recognized in the past many decades (Irfan 2021). Since the end of the previous century, renewable energy consumption has increased significantly worldwide because of global warming and damage to the environment caused by continued economic activity (Ponce and Alvarado 2019). Hence, hydroelectricity energy consumption has increased significantly for the facilities in their generation. Previous studies show that the use of renewable energy helps to mitigate environmental degradation (Baye et al. 2021; Haldar and Sethi 2021; Hao et al. 2021; Ponce et al. 2020a, b; Alvarado et al. 2018; Keček et al. 2019). Consequently, environmental interests have led to reorientation in the use of conventional energy to the use of clean energy.

Previous works on the energy-growth-environment nexus such as Khan et al. (2021a, b); Kongkuah et al. (2021); Li et al. (2021); and Muhammad et al. (2021) highlighted that high levels of energy consumption, although are crucial to economic growth, have a tendency to deteriorate the environment in developing and developed economies. There has been a continuous increase in energy use for developing countries like South Africa during recent years to achieve higher levels of living standards and economic development (Hao et al. 2021; Pata 2021; Ponce and Khan 2021; Wu et al. 2021; Zarco-Soto et al. 2021). Attaining higher ladders of economic development at the cost of natural environment is never desirable. Therefore, examining the role of renewable and non-renewable energy consumption in CO2 emissions has remained debatable in empirical literature due to differences in data sets, regions, and research methodologies employed (Zheng et al. 2021; Zhu and Zhang 2021). For instance, Irfan (2021), who uses an autoregressive distributed lag (ARDL) modelling approach to examine the integration between electricity and renewable energy certificate (REC) markets for India over the period January 2013-July 2020, finds that the traded volume of solar REC is influenced by the traded volume of electricity (positive effect), wholesale electricity price (negative effect), the traded volume of non-solar REC (positive effect), and price of solar REC (negative effect). The author’s findings further reveal that the traded volume of non-solar REC is influenced by only traded volume (positive effect) and price (positive effect) of solar REC. Similarly, Koondhar et al. (2021) use ARDL model to study the long-run relationship among bioenergy consumption, carbon emissions, and agricultural bioeconomic growth from 1971 to 2019 in China and find that an increase in bioenergy consumption causes an increase in agricultural bioeconomic growth both in the long- and short-run nexus. A decrease in fossil fuel consumption increases agricultural bioeconomic growth with respect to both long- and short-term effects. The authors suggested that China needs to switch from fossil fuel and other non-renewable energy consumption to sources of bioenergy and other renewable energy consumption to achieve carbon neutrality by 2060. Also, Ponce et al. (2021a, b), who use ARDL approach to examine the causal link between renewable energy consumption, GDP, GDP2, non-renewable energy price, population growth and forest area in high, middle- and low-income countries, find that an increase in the consumption of renewable energy increases square kilometres of forest cover. The authors concluded that growth in renewable energy consumption is one of the main drivers for preserving the forest area, and those responsible for making economic policies must aim their measures towards the use of clean energy.

South Africa is an interesting case study for this empirical work because its share of energy-led emissions is increasing. According to World Bank (2007), South Africa is one of the major emitters of CO2 (1% of the world emissions). The obvious reason for this is the use of coal, a major ingredient of CO2 in energy production. South Africa had coal reserves of 35,053 million tonnes at the end of 2016 that constitutes 3.68% of the world coal reserves. In 2020, the country’s coal proved reserves amounted to roughly 9.9 billion metric tonnes. South Africa consumes approximately 77 percent of the coal it produces as the country’s primary energy needs are provided by coal whereas 53% of the coal reserves are used in electricity generation, 33% in petrochemical industries, 12% in metallurgical industries, and 2% in domestic heating and cooking (Udeagha and Breitenbach 2021). Therefore, these characteristics make South Africa a compelling candidate for a separate study to investigate the presence of environmental Kuznets curve (EKC) in the country and to assess the environmental and growth effects of any possible fuel substitutions in the coming years. In this paper, we attempt to carry out a disaggregated analysis to test for the existence of long- and short-run relationship among individual energy consumption sources (such as hydroelectricity consumption, nuclear energy consumption, oil consumption, coal consumption and natural gas consumption), CO2 emissions, economic growth (scale and technique effects), and trade openness. We also implement causality tests to study the direction of causality between these variables to suggest optimal policies. Analysis of renewable and non-renewable energy consumption by source at disaggregate levels facilitates the examination of the relationships among each source of energy consumption, economic growth, trade openness and CO2 emissions. In addition, research at disaggregate level is essential for examining the barriers to replacing traditional energy resources with newer ones, along the lines with Greiner et al. (2018) who investigated whether natural gas consumption can mitigate CO2 emissions produced from coal consumption.

The novelty of our study relative to the existing literature lies mainly in the difference in analytical perspective. Previous studies on South Africa have investigated aggregate relationships among selected variables; however, this study examines the role of different renewable and non-renewable energy sources in CO2 emissions. With disaggregated level analysis, we are able to compare the individual impact of renewable and non-renewable energy consumption on CO2 emissions, economic growth (scale and technique effects), and trade openness. Our contribution also includes a comparative assessment of renewable and non-renewable consumption in a holistic manner to suggest a comprehensive policy framework towards CO2 emission reduction. The analysis provides valuable information for policymakers to construct an optimal combination of renewable and non-renewable sources in order to meet the national demand.

The remainder of the paper is organised as follows. Section 2 reviews related studies in the literature. Section 3 outlines the material and methods, while Sect. 4 discusses the results. Section 5 concludes with policy implications.

2 Literature review and contributions of the study

This section is divided into two sub-headings: while the first section describes the recent empirical evidence of energy consumption and CO2 emissions, the second section highlights the literature gap as well as provides the contributions of the study to scholarship on the effect of renewable and non-renewable energy consumption on CO2 emissions.

2.1 Review of previous literature

Environmental effect of energy consumption, which has been extensively investigated by earlier studies can be grouped into two categories of studies. The first category of studies uses “the aggregate energy consumption” to investigate its effect on environmental quality (see for example, Adebayo et al. 2021; Aslan et al. 2021; Doğanlar et al. 2021; Hongxing et al. 2021; Hu et al. 2021; Huang et al. 2021; Huo et al. 2021; Islam et al. 2021; Jian et al. 2021; Li et al. 2021; Kongkuah et al. 2021; Muhammad et al. 2021; Musah et al. 2021; Ng et al. 2021; Nosheen et al. 2021; Ren et al. 2021; Sayed et al. 2021; Tan and Lin 2021; Wu et al. 2021; Zarco-Soto et al. 2021; Zhang et al. 2021; Zhao et al. 2021; Zheng et al. 2021; Zhu and Zhang 2021; Flores-Chamba et al. 2019). Using the South Korean dataset over the period 1965–2019, Adebayo et al. (2021) find that aggregate energy consumption triggers CO2 emissions. Similarly, using the panel quantile for 17 Mediterranean countries over the period 1995–2014, Aslan et al. (2021) find that aggregate energy consumption deteriorates environmental quality. Doğanlar et al. (2021) also report that aggregate energy consumption deteriorates environmental quality for Turkey. Likewise, using dynamic ordinary least squares (DOLS) with data spanning the 1990 to 2018 period, Hongxing et al. 2021 conclude that energy consumption increases carbon emissions for 81 Belt and Road Initiative (BRI) economies. A study by Hu et al. (2021) also finds that aggregate energy consumption increases carbon emissions for Guangdong, China. Huang et al. (2021), Huo et al. (2021), Jian et al. (2021) and Li et al. (2021) draw similar conclusions for China. In addition, using the dynamic ARDL simulations model, Islam et al. (2021) find that aggregate energy consumption escalates carbon emissions for Bangladesh over the period 1972–2016. Kongkuah et al. (2021), who investigated the role of aggregate energy consumption in carbon emissions for Belt and Road, OECD countries, find that aggregate energy consumption increases carbon emission. Using a Spatial Durbin Model (SDM) through which the existence of “spillovers” was determined in the implementation of energy policy, Flores-Chamba et al. (2019) analysed the effect of human capital, oil price, and Kyoto Protocol policy on energy consumption in EU over the period 2000–2016. The authors found that the oil price, the value added in services, and employment in industry have statistically negative spatial effects, an increase in these variables reduces energy consumption of the analysed data panel; unlike the value added in industry and employment in services that have a statistically positive relationship with energy consumption. An increase in these two variables increases energy consumption.

Also, Say and Yucel (2006) find that aggregate energy consumption contributes to increase CO2 emissions for Turkey. Similar results are reported by Alam et al. (2012), who show that the aggregate energy consumption has intensified the environmental decay in Bangladesh. Empirical study by Park and Hong (2013) reveals that an increase in total energy consumption worsens the environmental decay in South Korea. This finding is in line with Shahbaz et al. (2013b), who show that an upsurge in aggregate energy use considerably deteriorates the Malaysian environment. Equally, Shahbaz et al. (2013d) find that an increase in total energy use has a damaging effect and contributes greatly to worsen Indonesia’s environmental condition. Wang et al. (2016), who employed the ARDL approach over the period 1990–2012 for China, reveals that higher aggregate energy consumption causes rising environmental collapse. This evidence is further supported by the study by Chang (2010), who provides similar results using Chinese dataset over the period 1981–2006. Furthermore, Farhani and Ben Rejeb (2012) extend the framework suggested by Chang (2010) to examine the environmental effect of aggregate energy consumption and their findings show that a rise in aggregate energy use is harmful to the environment of MENA region under review. Building on the Farhani and Ben Rejeb (2012) model by incorporating the effects of trade openness and urbanisation on the environmental quality, Omri (2013) finds that an upsurge in total energy consumption significantly contributes to deteriorate the environmental condition of MENA countries. Hossain (2011)’s findings show that an increase in aggregate energy consumption leads to environmental dilapidation of the newly industrialised economies. This evidence is further aligned with the conclusion reached by Shahbaz et al. (2015), who show that higher energy consumption increases environmental decay in low-, middle- and high-income categories. Further studies by Islam et al. (2021) for Bangladesh; Kongkuah et al. (2021) for Belt and Road, OECD countries; Muhammad et al. (2021) for Muslim countries; Musah et al. (2021) for North Africa; Ng et al. (2021) for China; Ren et al. (2021) for 30 Chinese provincial administrative regions; Nosheen et al. (2021) for Asian economies; Dogan and Turkekul (2016) for USA; Soytas et al. (2007) for USA; Halicioglu (2009) for Turkey; Ozturk and Al-Mulali (2015) for Cambodia; Pao et al. (2011) for Russia; Farhani and Ozturk (2015) for Tunisia; Ajmi et al. (2015) for G7 countries; Ozcan (2013) for Middle East countries; Dogan et al. (2015) for OECD countries; Pao and Tsai (2011) for BRIC countries; Saboori and Sulaiman (2013) for ASEAN; Lean and Smyth (2010) for ASEAN; Heidari et al. (2015) for five ASEAN countries; Acaravci and Ozturk (2010) for Europe; Atici (2009) for Central and Eastern Europe, all provide strong evidence that a rise in aggregate energy use deteriorates environment.

The second group of studies disaggregates the total energy consumption into renewable and non-renewable sources to explore their individually environmental effects (see for example, Ponce and Khan 2021; Ponce et al. 2021a, b; Khan et al. 2021a, b; Khan et al. 2022; Ibrahim and Ajide 2021; Rodriguez-Alvarez 2021; Ponce et al. 2020a, 2020b; Baye et al. 2021; Haldar and Sethi 2021; Alharthi et al. 2021; Hao et al. 2021; Pata 2021; Khan et al. 2021a, b; Sharif et al. 2021; Chiu and Chang 2009; Apergis et al. 2010; Boluk and Mert 2014; Al-Mulali et al. 2015; Bilgili et al. 2016; Lopez-Menendez et al. 2014; Al-Mulali and Ozturk 2016). For example, Ponce and Khan (2021), who explore the long-term nexus between CO2 emissions and renewable energy, energy efficiency, fossil fuels, GDP, property rights from 1995 to 2019 in nine developed countries, find that renewable energy and energy efficiency are negatively correlated with CO2 emissions. In developed European countries, an increase in renewable energy consumption brings about a decrease in CO2 emissions. Using the second-generation econometric techniques (cross-sectionally augmented Dickey–Fuller (CADF) and cross-sectionally augmented IPS (CIPS), Ponce et al. (2021a, b) examine the long-term relationship between economic growth and financial development, non-renewable energy, renewable energy, and human capital in 16 Latin American countries over the period 1988–2018. The authors find that the consumption of renewable energy does not compromise economic growth, and, an increase in renewable energy consumption increases economic growth. The authors suggested some measures to ensure economic growth considering the role of green energy and human capital. Similarly, Khan et al. (2021a, b) find that business data analytics and different levels of technological innovation within the developing market significantly shape the firm’s performance to improve environmental quality.

Also, Khan et al. (2022), who examine how environmental technology contributes to wastewater improvement in 16 selected OECD countries during 2000–2019, find that a heterogeneous behaviour in the quantiles of wastewater treatment, environmental technology and renewable energy are positively related to an increase in wastewater treatment. The authors suggested promoting environmental technology to improve wastewater treatment as part of policy considerations for environmental sustainability. Ibrahim and Ajide (2021) investigate the dynamic impacts of disaggregated non-renewable energy, trade openness, total natural resource rents, financial development and regulatory quality on environment quality of the BRICS economies from 1996 to 2018. The authors find that coal and fuel from both angles of production and consumption and gas production are found to be carbon emission inducing while gas consumption turns out to be carbon emission abating. As part of policy considerations, the authors suggested gas promotion and discouragement of coal and fuel adoption as strategies to improving environmental quality in BRICS. Using a novel approach that allows differentiation between potential and observed health, Rodriguez-Alvarez (2021), who examines the relationship between health and air pollution, finds that the main pollutants affecting European countries, namely NOx, PM10 and PM2.5 have a negative impact on life expectancy at birth, while investment in renewable energies has a positive effect.

Furthermore, Ponce et al. (2020a, b), who assess the causal link between renewable and non-renewable energy consumption, human capital, and non-renewable energy price for the 53 most renewable energy-consuming countries worldwide (hydroelectric) during the period 1990–2017, find that human capital has a stronger significant effect on renewable energy consumption at the global level, in the middle high-income countries and low-middle income countries, compared with non-renewable energy consumption. Besides, at the global level, there is a positive and statistically significant relationship between the non-renewable energy price and the two types of energy consumption. Using a two-way effects econometric model, Ponce et al. (2020a, b) examine the effect of the liberalisation of the internal energy market on CO2 emissions in the European Union during the period 2004–2017 and find that the liberalisation of the internal energy market is negatively related to CO2 emissions; the policy was effective in reducing CO2 emissions and, therefore, slowing down climate change. In addition, Baye et al. (2021), who investigate the determinants of renewable energy consumption for 32 Sub-Saharan African countries using corrected least squares dummy variable estimator (LSDVC), find that advancement in technology, quality of governance, economic progress, biomass consumption, and climatic conditions influence renewable energy consumption. The authors suggested the harmonisation of clean energy markets and development of a policy mix that combines environmental, economic, and social factors in attaining the Sustainable Development Goals as part of policy considerations. Haldar and Sethi (2021) find that renewable energy consumption reduces emissions significantly in the long run and that the policymakers need to improve the quality of institutions and deploy more renewable energy for final consumption to achieve long-term climate goals.

Similarly, empirical study by Chiu and Chang (2009) assesses the threshold impact of renewable energy consumption on environmental quality in OECD group. Authors find that renewable energy consumption contributes to CO2 emissions for lower threshold, while improving the environmental quality for upper threshold. Similarly, Apergis et al. (2010) demonstrate that renewable energy source deteriorates environmental quality of less developed and industrialised countries across the world. Also, Boluk and Mert (2014) conclude that both renewable and non-renewable energy consumptions contribute to increase CO2 emissions in EU countries. On the contrary, for European countries, Al-Mulali et al. (2015)’s findings illustrate that renewable energy consumption mitigates CO2 emissions. Similar results are reported by Bilgili et al.(2016), who investigate the role of renewable energy consumption in fostering environmental quality in OECD countries. The authors show that renewable energy consumption contributes to mitigate the growing levels of carbon emissions among OECD countries. Furthermore, in the case of EU countries, Lopez-Menendez et al. (2014) find that renewable energy source mitigates carbon emissions. The empirical study by Al-Mulali and Ozturk (2016) using a panel of 27 industrialised nations, demonstrates that renewable energy source is environmentally friendly, while non-renewable energy use intensifies environmental dilapidation.

Table 1 further presents a summary of selected literature on the nexus between energy consumption and CO2 emissions to reflect more comparison against different regions.

Table 1 Synopsis of studies

2.2 Literature gap and contributions of the study

Based on the literature review, previous studies have used either the aggregate energy consumption or disaggregated energy sources (i.e. total renewable or total non-renewable or both) to examine their effects on environmental quality. However, less explored in empirical literature are the effects of disaggregated levels of renewable and non-renewable energy sources on environmental quality for South Africa. This is an important gap that this paper intends to fill because the use of aggregate data may not show the strength or explanatory power of several energy sources on CO2 emissions. Moreover, given South Africa’s present challenges in ascertaining the optimal mix of energy, the effect of individual sources is crucial.

Furthermore, earlier works such as those mentioned above, which investigated the environmental effect of aggregate energy consumption or renewable and non-renewable energy consumption, while controlling for trade openness have one thing in common. They all proxy trade openness by utilising trade intensity (TI) and applying a simple ARDL methodology. The TI-based proxy, normally described as the ratio of trade (sum of exports and imports) to GDP, only captures the trade of a country in relation to its share of income (GDP), although it is not contrived. While it is intuitively sensible, the proxy does not help to resolve the ambiguity on how trade is measured and defined. Its main shortcoming is that it reflects only one dimension focusing on the comparative position of trade performance of a country linked to its domestic economy. In other words, this proxy only focuses on the question of how enormous the income contribution of a country in international trade is. Consequently, it woefully fails to address another crucial dimension of trade openness that is how important the explicit level of trade of a country to world trade is. This implies that this measure is unable to truly reflect the correct idea of trade openness and accurately capture the precise environmental impact of trade. Also, the use of the proxy penalises bigger economies like Germany, the US, France, China, Japan and so many others because they are being classified as closed economies due to their larger GDPs, whereas the poor countries such as Zimbabwe, Zambia, Venezuela, Uganda, Ghana, Nigeria, Togo and many others are grouped as open economies due to their small GDPs (Squalli and Wilson 2011). Given this, the proxy fails to reflect credibly the exact idea of trade openness because it does not capture the advantages a country enjoys while engaging enormously in global trade (Squalli and Wilson 2011). In addition, the diverse findings and conflicting results about the environmental effect of energy use are blamed on different methodologies and misspecification problems.

Against this background, we contribute to scholarship on the effect of renewable and non-renewable energy consumption on CO2 emissions in five ways: firstly, the novelty of our study relative to the existing literature lies mainly in the difference in analytical perspective. Previous studies on South Africa have investigated the effect of aggregate energy consumption on environmental quality; however, less explored in empirical literature are the effects of disaggregated levels of renewable and non-renewable energy sources on environmental quality. This is an important gap that this paper intends to fill because the use of aggregate data may not show the strength or explanatory power of several energy sources on CO2 emissions. Moreover, given South Africa’s present challenges in ascertaining the optimal mix of energy, the effect of individual sources is crucial. Therefore, this study examines the role of different renewable (such as hydroelectricity and nuclear energy consumption) and non-renewable energy sources (such as oil, coal and natural gas consumptions) in CO2 emissions. With disaggregated level analysis, we are able to compare the individual impact of renewable and non-renewable energy consumption on CO2 emissions. Our contribution also includes a comparative assessment of renewable and non-renewable consumption in a holistic manner to suggest a comprehensive policy framework towards CO2 emission reduction. The analysis provides valuable information for policymakers to construct an optimal combination of renewable and non-renewable sources in order to meet the national demand.

Secondly, previous studies, which globally examined the nexus between renewable and non-renewable energy consumption, and CO2 emissions have widely used the simple ARDL approach proposed by Pesaran et al. (2001) and other cointegration frameworks that can only estimate and explore the long- and short-run relationships between the variables under review. However, the present study contributes to the extant literature on methodological front by using an advanced econometric technique, namely, the novel dynamic ARDL simulations model proposed by Jordan and Philips (2018), which overcomes the limitations of the simple ARDL approach. The novel dynamic ARDL simulations model can effectively and efficiently resolve the prevailing difficulties and result interpretations associated with the simple ARDL approach. This newly developed framework is capable of simulating and plotting to predict graphs of (positive and negative) changes in the variables automatically and also estimate their relationships for long run and short run. Therefore, the adaptation of this method in this present study enables us to obtain unbiased and accurate results.

Thirdly, previous studies on the effect of renewable and non-renewable energy consumption on CO2 emissions while controlling for trade openness were faulted with the manner in which trade openness is defined and proxied. This paper further contributes by adopting an inventive measure of trade openness proposed by Squalli and Wilson (2011) to capture trade share in GDP as well as the size of trade relative to the global trade. Therefore, employing the Squalli and Wilson proxy of trade openness in this study remarkably differentiates our paper from others, which predominantly used TI-based measure of trade openness.

Fourthly, the present study contributes to scholarship by using the frequency domain causality (FDC) approach, the robust testing strategy suggested by Breitung and Candelon (2006) which permits us to capture permanent causality for medium term, short term and long term among the variables under review. This test is also used for robustness check in this study. To the best of our knowledge, previous studies have not used this test in the nexus between renewable, non-renewable and CO2 emissions especially in the context of South Africa. Lastly, the study employs the second-generation econometric procedures accounting robustly for the multiple structural breaks which have been considerably ignored in earlier studies. In light of this, the paper uses the Narayan and Popp’s structural break unit root test since empirical evidence shows that structural breaks are persistent such that many macroeconomic variables like CO2 emissions, renewable and non-renewable energy consumption are affected by structural breaks.

3 Material and methods

This study disaggregates the environmental effects of renewable and non-renewable energy sources for South Africa by utilising the novel dynamic ARDL simulations model capable of stimulating and plotting to predict graphs of (positive and negative) changes in the variables automatically and estimate their relationships for the long run and short run. Before implementing the novel dynamic ARDL simulations model, it is important to conduct a stationarity test on the variables to ascertain their order of integration. In light of this, we employ four traditional unit root tests such as Dickey-Fuller GLS (DF-GLS), Phillips-Perron (PP), Augmented Dickey-Fuller (ADF) and Kwiatkowski-Phillips-Schmidt-Shin (KPSS). The Narayan and Popp’s structural break unit root test is used to account for structural breaks in the variables. The novel dynamic ARDL simulations model is used to estimate the short- and long-run coefficients of the variables under review. The frequency domain causality (FDC) approach, the robust testing strategy suggested by Breitung and Candelon (2006) is further used to capture permanent causality for medium term, short term and long term among the variables under review. This test is also used for robustness check in this study.

3.1 Functional form

This work follows the robust empirical approach widely used in earlier studies by adopting the usual EKC hypothesis framework to disaggregate the environmental effects of renewable and non-renewable energy consumption for South Africa. The EKC hypothesis contends that economic growth contributes immensely to deteriorate the environmental quality because during the earlier societal developmental stage, more attention was paid to achieving higher income than realising minimum environmental decay. Consequently, higher economic growth, which inevitably contributed to worsen the environmental condition was pursued vigorously at the expense of lower carbon emissions.

This reason thus intuitively explains the rationale behind the positive relationship between the scale effect (proxy for economic growth) and the environmental quality. As the society progressed, especially during the advanced industrial stage, people became more environmentally conscious, and governments introduced environmental laws aimed at improving environmental quality. Thus, during this stage of development, people’s predisposition for a clean environment as well as the enforcement of more stringent environmental standards resulted in better environmental condition as income increased. This reason therefore intuitively explains the rationale behind the negative relationship between the technique effect (square of economic growth) and the environmental quality. In its standard form, following Udeagha and Breitenbach (2021) and Udeagha and Ngepah (2019), the standard EKC hypothesis is thus presented as follows:

$$CO_{2} = F\left( {SE, TE} \right)$$
(1)

where CO2 represents CO2 emissions, an environmental quality measure; SE denotes scale effect, a proxy for economic growth; and TE represents technique effect, which captures the square of economic growth. Log-linearising Eq. (1) brings about the following:

$${\text{ In}}CO_{2t} = \alpha + \varphi InSE_{t} + \beta InTE_{t} + \varepsilon_{t}$$
(2)

Scale effect (economic growth) deteriorates environmental quality as income increases; however, technique effect improves the environment due to the implementation of environmental laws and people’s predisposition for the carbon-free environment (Cole and Elliott 2003; Ling et al. 2015). Given this background, for EKC hypothesis to be present, the theoretical expectations require that: \(\varphi >0\) and \(\beta <0\). Following literature, as a control variable in the equation connecting renewable and non-renewable energy consumption and CO2 emissions, we use trade openness. Accounting for this variable while disaggregating the environmental effects of renewable and non-renewable energy consumption, Eq. (2) is thus augmented as follows:

$${\text{ In}}CO_{2t} = \alpha + \varphi InSE_{t} + \beta InTE_{t} + \rho InHYD_{t} + \pi InNUC_{t} + \delta InOIL_{t} + \tau InCOAL_{t} + \omega InGAS_{t} + \gamma InOPEN_{t} + U_{t}$$
(3)

where \({InHYD}_{t}\) is hydroelectricity consumption; \(In{NUC}_{t}\) denotes nuclear energy consumption; \(In{OIL}_{t}\) captures oil consumption;\(In{COAL}_{t}\) denotes coal consumption;\(In{GAS}_{t}\) captures natural gas consumption, and \({InOPEN}_{t}\) represents trade openness. All variables are in natural log. \(\varphi ,\beta ,\rho , \pi , \delta , \tau , \omega and \gamma\) are the estimable coefficients capturing different elasticities whereas \({U}_{t}\) captures the stochastic error term with standard properties.

3.2 Measuring trade openness

The composite trade intensity (CTI) as a measure of trade openness is used in this work following Squalli and Wilson (2011) to robustly account for trade share in GDP and the size of trade relative to global trade. Adopting this way to measure trade openness enables us to effectively address the shortcomings of conventional trade intensity (TI) widely used in earlier studies. More importantly, the novel CTI contains more crucial information pertaining to a country’s trade contribution share in terms of global economy. In addition, it mirrors trade outcome reality because it contains two dimensions of a country’s ties with the rest of the world. The CTI is presented thus as follows:

$$CTI = \frac{{\left( {X + M} \right)_{i} }}{{\frac{1}{n}\mathop \sum \nolimits_{j = 1}^{n} \left( {X + M} \right)_{j} }} \frac{{\left( {X + M} \right)_{i} }}{{GDP_{i} }}$$
(4)

where: i reflects South Africa; j captures her trading partners. In Eq. (4), the first portion represents global trade share, whereas the second segment denotes trade share of South Africa.

3.3 Variables and data sources

This paper uses yearly times series data covering the period 1960–2019. CO2 emissions, as the proxy for environmental quality is the dependent variable. Economic growth proxied by scale effect and the square of economic growth capturing the technique effect are used to validate the presence of EKC hypothesis. For renewable energy sources, we have used hydroelectricity consumption and nuclear energy consumption, while in the case of non-renewable energy sources, the study uses oil, coal and natural gas consumptions. The other important variable controlled for, following literature is trade openness (OPEN), which is proxied by a composite trade intensity calculated as shown above. Table 2 therefore summarises the variable definition and data sources.

Table 2 Definition of variables and data sources

3.4 Narayan and Popp’s structural break unit root test

As a first step, before implementing the novel dynamic ARDL simulations model, it is important to conduct a stationarity test on the variables under review to ascertain their order of integration. Thus, this work employs Dickey-Fuller GLS (DF-GLS), Phillips-Perron (PP), Augmented Dickey-Fuller (ADF) and Kwiatkowski-Phillips-Schmidt-Shin (KPSS) unit root tests. The Narayan and Popp’s structural break unit root test is further used since empirical evidence shows that structural breaks are persistent such that many macroeconomic variables like CO2 emissions, renewable and non-renewable energy consumptions are affected by structural breaks.

3.5 ARDL bounds testing approach

This paper employs the bounds test to examine the environmental effects of disaggregated levels of renewable and non-renewable energy sources for long run. The ARDL bounds testing approach, following Pesaran et al. (2001), is presented as follows:

$${\Delta In{CO}_{2t}=\gamma }_{0}+\sum_{i=1}^{n}{\gamma }_{1i}\Delta {InCO}_{2t-i}+\sum_{i=0}^{n}{\gamma }_{2i}\Delta {InSE}_{t-i}+\sum_{i=0}^{n}{\gamma }_{3i}\Delta In{TE}_{t-i}+\sum_{i=0}^{n}{\gamma }_{4i}\Delta {HYD}_{t-i}+\sum_{i=0}^{n}{\gamma }_{5i}\Delta {NUC}_{t-i}+\sum_{i=0}^{n}{\gamma }_{6i}\Delta {InOIL}_{t-i}+{\sum }_{i=0}^{n}{\gamma }_{7i}\Delta {InCOAL}_{t-i}+{\sum }_{i=0}^{n}{\gamma }_{8i}\Delta {InGAS}_{t-i}+\sum_{i=0}^{n}{\gamma }_{9i}\Delta In{OPEN}_{t-i}+{\theta }_{1}{InC{O}_{2}}_{t-i}+{\theta }_{2}{InSE}_{t-i}+{\theta }_{3}{InTE}_{t-i}+{\theta }_{4}{InHYD}_{t-i}{+\theta }_{5}{InNUC}_{t-i}+{\theta }_{6}{InOIL}_{t-i}+{\theta }_{7}{InCOAL}_{t-i}+{\theta }_{8}{InGAS}_{t-i}+{\theta }_{9}{InOPEN}_{t-i}+{\varepsilon }_{t}$$
(5)

where \(\Delta\) represents the first difference of InCO2, InSE, InTE, InHYD, InNUC, InOIL, InCOAL, InGAS and InOPEN whereas \({\varepsilon }_{t}\) is the white noise. Meanwhile, t-i denotes the optimal lags selected by Schwarz's Bayesian Information Criterion (SBIC), \(\gamma\) and \(\theta\) are the estimated coefficients for short run and long run, respectively. The ARDL model for the long- and short-run will be approximated if the variables are cointegrated. The null hypothesis, which tests for long-run relationship is as follows:\({({H}_{0}:\theta }_{1}={\theta }_{2}={\theta }_{3}={\theta }_{4}={\theta }_{5}={\theta }_{6}={\theta }_{7}={\theta }_{8}={\theta }_{9}=0\)) against the alternative hypothesis \({({H}_{1}:\theta }_{1}\ne {\theta }_{2}\ne {\theta }_{3}\ne {\theta }_{4}\ne {\theta }_{5}\ne {\theta }_{6}\ne {\theta }_{7}\ne {\theta }_{8}\ne {\theta }_{9}\ne 0)\).

Rejection or acceptance of null hypothesis depends on the value of the calculated F-statistic. If the value of calculated F-statistic is greater than the upper bound, we reject the null hypothesis and conclude that the variables are having a long-run relationship or there is evidence of cointegration. However, cointegration does not exist if the value of calculated F-statistic is less than the lower bound. In addition, if the value of the calculated F-statistic lies between lower and upper bounds, the bounds test becomes inconclusive. If the variables are having a long-run relationship, then the long-run ARDL model to be estimated is as follows:

$$\Delta In{CO}_{2t}={\beta }_{0}+\sum_{i=1}^{q}{{\omega }_{1}InC{O}_{2}}_{t-i}+\sum_{i=1}^{q}{\omega }_{2}{InSE}_{t-i}+\sum_{i=1}^{q}{\omega }_{3}{InTE}_{t-1}+\sum_{i=1}^{q}{\omega }_{4}{InHYD}_{t-i}+\sum_{i=1}^{q}{\omega }_{5}{InNUC}_{t-1}+\sum_{i=1}^{q}{\omega }_{6}{InOIL}_{t-1}+\sum_{i=1}^{q}{\omega }_{7}{InCOAL}_{t-1}+\sum_{i=1}^{q}{\omega }_{8}{InGAS}_{t-1}+\sum_{i=1}^{q}{\omega }_{9}{InOPEN}_{t-1}+{\varepsilon }_{t}$$
(6)

\(\omega\) denotes the long-run variance of variables in Eq. (6). In choosing the correct lags, the paper uses the SBIC. For short-run ARDL model, the error correction model used is as follows:

$$\Delta In{CO}_{2t}={\beta }_{0}+\sum_{i=1}^{q}{{\pi }_{1}\Delta InC{O}_{2}}_{t-i}+\sum_{i=1}^{q}{\pi }_{2}\Delta {InSE}_{t-i}+\sum_{i=1}^{q}{\pi }_{3}\Delta {InTE}_{t-1}+\sum_{i=1}^{q}{\pi }_{4}{\Delta InHYD}_{t-i}+\sum_{i=1}^{q}{\pi }_{5}\Delta {InNUC}_{t-1}+\sum_{i=1}^{q}{\pi }_{6}{In\Delta OIL}_{t-1}+\sum_{i=1}^{q}{\pi }_{7}\Delta {InCOAL}_{t-1}+\sum_{i=1}^{q}{\pi }_{8}\Delta {InGAS}_{t-1}+\sum_{i=1}^{q}{\pi }_{8}\Delta {InOPEN}_{t-1}+{EC{T}_{t-i}+\varepsilon }_{t}$$
(7)

In Eq. (7), \(\pi\) reflects the short-run variability of the variables, whereas ECT denotes the error correction term that captures the adjustment speed of disequilibrium. The estimated coefficient for ECT ranges from -1 to 0. This work further uses the diagnostic tests for model stability. The Breusch Godfrey LM test is used to check for serial correlations; the Breusch-Pagan-Godfrey test and the ARCH test are both employed to test for heteroscedasticity; the Ramsey RESET test is used to ensure that the model is correctly specified, and the Jarque–Bera Test is used to test whether the estimated residuals are normally distributed. To check for structural stability, this paper employs the cumulative sum of recursive residuals (CUSUM) and cumulative sum of squares of recursive residuals (CUSUMSQ).

3.6 Dynamic autoregressive distributed lag simulations

Previous studies, which investigated the effects of renewable and non-renewable energy consumption on CO2 emissions have widely used the simple ARDL approach proposed by Pesaran et al. (2001) and other cointegration frameworks that can only estimate and explore the short- and long-run relationships between the variables. To address the shortcomings which characterise the simple ARDL model, Jordan and Philips (2018) recently developed a novel dynamic ARDL simulations model that can effectively and efficiently resolve the prevailing difficulties and result interpretations associated with the simple ARDL approach. This newly developed framework is capable of stimulating and plotting to predict graphs of (positive and negative) changes in the variables automatically and estimate the relationships for short run and long run. The major advantage of this framework is that it can predict, stimulate and immediately plot probabilistic change forecasts on the dependent variable in one explanatory variable while holding other regressors constant. In this study, based on the multivariate normal distribution for the parameter vector, the dynamic ARDL error correction algorithm uses 1000 simulations. We employ the graphs to examine the actual change of an explanatory variable as well as its influence on the dependent variable. The novel dynamic ARDL simulations model is presented as follows:

$$\Delta In{CO}_{2t}={\alpha }_{0}+{\upsilon }_{0}{InCO}_{2t-1}+{\varphi }_{1}\Delta {SE}_{t}+{\rho }_{1}{SE}_{t-1}+{\varphi }_{2}\Delta {TE}_{t}+{\rho }_{2}{TE}_{t-1}+{\varphi }_{3}\Delta {HYD}_{t}+{\rho }_{3}{HYD}_{t-1}+{\varphi }_{4}\Delta {NUC}_{t}+{\rho }_{4}{NUC}_{t-1}+{\varphi }_{5}\Delta {OIL}_{t}+{\rho }_{5}{OIL}_{t-1}+{\varphi }_{6}\Delta {COAL}_{t}+{\rho }_{6}{COAL}_{t-1}+{\varphi }_{7}\Delta {GAS}_{t}+{\rho }_{7}{GAS}_{t-1}+{\varphi }_{8}\Delta {OPEN}_{t}+{\rho }_{8}{OPEN}_{t-1}+{\varepsilon }_{t}$$
(8)

3.7 Frequency domain causality test

Lastly, this paper uses the frequency domain causality (FDC) approach, the robust testing strategy suggested by Breitung and Candelon (2006) to explore the causal relationships among the variables under scrutiny. Unlike the traditional Granger causality approach where it is extremely impossible to predict the response variable at a particular time frequency, FDC enables that and further permits to capture permanent causality for medium term, short term and long term among the variables under examination. This test is also used for robustness check in this study.

4 Empirical results and their discussion

4.1 Summary statistics

The summary statistics of the variables used in this work are analysed and scrutinized before discussing the results. Table 3 reports the overview of statistics showing that the CO2 emissions average value is 0.264. Coal consumption (COAL) has the average mean of 79.887 greater than other variables. This is followed by the technique effect (TE), the square of GDP per capita, which has the average mean of 60.316. In addition to characterising the summary statistics, Table 3 uses kurtosis to represent the peak while the Jarque–Bera test statistics is used to check for normality of our data series. The variance in coal consumption (COAL) is the highest of all the variables showing the high level of volatility in this variable. The variance in CO2 emissions is less relative to coal consumption showing that CO2 emissions are far more stable. Also, the variations in technique effect (TE), oil consumption (OIL), trade openness (OPEN), natural gas consumption (GAS), scale effect (SE) and nuclear energy consumption (NUC) are quite greater. In addition, the Jarque–Bera statistics shows that our data series are normally distributed.

Table 3 Descriptive statistics.

4.2 Order of integration of the respective variables

Table 4 reports the results of DF-GLS, PP, ADF and KPSS showing that after first differencing, all variables which are non-stationary in level become stationary at I (1). This implies that all the series under review are either I(1) or I(0) and none is I(2). The traditional unit root tests reported do not account for structural breaks. Therefore, this work implements a testing strategy capable of accounting for two structural breaks in the variables. Also, Table 4 reports the findings of Narayan and Popp’s unit root test with two structural breaks in the right-hand panel. The empirical evidence shows that the null hypothesis of unit root cannot be rejected. Consequently, all data series are integrated of order one and prospective application for the dynamic ARDL bounds testing approach.

Table 4 Unit root analysis.

4.3 Lag length selection results

Table 5 reports the findings of different test criteria for lags selection. The use of HQ, AIC and SIC is documented in empirical literature as the most popular for selecting appropriate lags. In this study, SIC is used for lag selection. Based on this tool, lag one is more appropriate. This is because the lowest value is obtained at lag one when SIC is used unlike others.

Table 5 Lag length criteria.

4.4 Cointegration test results

Table 6 displays the results of the cointegration test utilizing the surface-response regression suggested by Kripfganz and Schneider (2018). Since the F- and t-statistics are greater than the upper bound critical values at various significance levels, we reject the null hypothesis. Thus, our empirical evidence suggests that cointegration exists among the variables under consideration.

Table 6 ARDL bounds test analysis

4.5 Diagnostic statistics tests

To ensure that our chosen model is reliable and consistent, the study therefore uses different diagnostic statistics tests, and Table 7 reports their empirical results. The empirical evidence suggests that our model is well fitted having passed all the diagnostic tests. The model does not suffer from the problems of serial correlation and autocorrelation as confirmed by the Breusch Godfrey LM test. The Ramsey RESET test is used and evidence shows that the model does not suffer from misspecification. The Breusch-Pagan-Godfrey test and ARCH test are both employed to test if there is evidence of heteroscedasticity in the model. The empirical findings suggest that heteroscedasticity is moderate and not a problem. Finally, the Jarque–Bera test result shows that the model’s residuals are normally distributed.

Table 7 Diagnostic statistics tests.

4.6 Dynamic ARDL simulations model results

The dynamic ARDL simulations model results are reported in Table 8. Our findings show that the scale effect (InSE) and technique effect (InTE) positively and negatively affect CO2 emissions, respectively. The scale effect representing economic growth deteriorates environmental quality, whereas the technique effect has a mitigating effect on the environment. The empirical evidence therefore suggests that the EKC hypothesis holds in the case of South Africa, where real income grows until a certain threshold level whereas CO2 emissions start to decline. In the initial stage of economic growth, the environmental quality decreases, whereas after reaching the optimum level, environmental quality starts improving in South Africa. This supports the inverted U-shaped relationship between economic growth and environmental quality. The findings are justifiable for South Africa and associated with structural change and technological advancement in the country. Environmental awareness increases among the people as income grows, so environmental regulations are enforced to use energy-efficient technologies to mitigate pollution. These results coincide with the work of Udeagha and Breitenbach (2021), who highlight the existence of EKC hypothesis for the Southern African Development Community (SADC) over the period 1960–2014. Alharthi et al. (2021) also find similar results that EKC hypothesis exists for the Middle East and North Africa (MENA) countries. Likewise, Bibi and Jamil (2021), who examine the association between air pollution and economic growth, find a support for the EKC hypothesis, which suggests an inverted U-shaped link between air pollution and economic growth in six different regions including Latin America and the Caribbean, East Asia and the Pacific, Europe and Central Asia, South Asia, the Middle East and North Africa, and Sub-Saharan Africa. Udeagha and Ngepah (2019) also find that the EKC hypothesis exists for South Africa. Our results further reciprocate the findings of Isik et al. (2021) for 8 Organisation for Economic Co-operation and Development (OECD) countries, Liu et al. (2021) for China, Sun et al. (2021) for China, Naqvi et al. (2021) for 155 countries of four different income groups, and Murshed (2021) for six South Asian economies. However, the findings contradict with Minlah and Zhang (2021), who find that the Environmental Kuznets Curve for carbon dioxide emissions for Ghana is upward sloping, contrary to the standard Environmental Kuznets Curve theory which postulates an inverted “U”-shaped relationship between economic growth and environmental degradation. Ozturk (2015), Sohag et al. (2019), Tedino (2017), and Mensah et al. (2018) also find similar results showing that the EKC hypothesis does not hold.

Table 8 Dynamic ARDL simulations analysis.

For renewable energy consumption, the long-run estimated coefficient on hydroelectricity consumption is statistically significant and negative showing that a 1% upsurge in hydroelectricity consumption brings about a reduction in CO2 emissions by 0.52%. However, the short-run estimated coefficient on hydroelectricity consumption is not statistically significant although it is negative. As Faisal et al. (2021) mentioned, the generation of hydroelectricity and other renewable energies through the use of wind, water, and other sources lessens the global destruction caused by the CO2 emissions produced by other sources of energies, such as the consumption of fossil fuel energy, which includes oil, gas, petroleum, and coal. This further encourages the use of hydroelectric power and other renewable sources of energy that have a significant effect in decreasing the dangerous emissions, thus ensuring sustainable development (Nosheen et al. 2021). Our empirical findings are consistent with Aydin (2010), who identified that building hydropower plants in Turkey has a long-term favourable influence on carbon emissions. Similarly, Bello et al. (2020) show that switching from high carbon-emitting fuels to renewable energy such as hydropower will substantially reduce CO2 emission and assist the country towards achieving the carbon emissions reduction targets. Also, Ummalla et al. (2019), who investigated the nexus among the hydropower energy consumption, economic growth, and CO2 emissions in the context of BRICS countries over the period 1990–2016, find that the effect of hydropower energy use significantly promotes economic growth, and improves environmental quality across all quantiles These results further highlight the findings of Solarin et al. (2017), who affirm the abating role of hydroelectricity energy on CO2 emissions for China and India over the period 1965–2013. However, our findings contradict with Faisal et al. (2021) and Naeem et al. (2021), who find that hydroelectricity consumption deteriorates environmental quality for an emerging economy and Pakistan respectively.

For nuclear energy consumption, the short-and long-run estimated coefficients are both negative and statistically significant suggesting that a 1% upsurge in nuclear energy consumption leads to a 0.27% and 0.59% reduction in CO2 emissions in the long run and short run, respectively. As Aslan et al. (2021) mentioned, the importance of nuclear energy has been increasing as a result of its advantages by producing heat and electricity without emitting carbon-dioxide into the atmosphere at the power plant level. These results highlight the findings of Nathaniel et al. (2021) and Syed et al (2021), who affirm the abating role of nuclear energy on CO2 emissions for the G7 countries and India respectively. Using the dynamic ARDL framework over the period 1994Q1-2018Q4, Khan and Ahmad (2021) conclude that nuclear energy helps in reducing environmental degradation in China. Hassan et al. (2020), who used annual data from 1993 to 2017 in the context of BRICS, find nuclear energy consumption to be effective in reducing CO2 emissions. Also, Piłatowska et al. (2020) highlight that nuclear energy consumption plays a key role in curbing CO2 emissions in Spain. Similar results were found by Baek (2016), who illustrated that nuclear energy consumption improves environmental quality in the USA over the period 1960–2010. Similarly, Dong et al. (2018) use both linear and non-linear frameworks and find nuclear energy consumption to be effective in reducing CO2 emissions in the context of China between 1993 and 2016. However, our findings contradict with Mahmood et al. (2019), who show that nuclear energy consumption deteriorates environmental quality in Pakistan between 1973 and 2017. Similarly, Sarkodie and Adams (2018) demonstrate that nuclear energy consumption escalates the growing levels of carbon emissions in South Africa. Recently, Usman et al. (2020) find nuclear energy consumption to be ineffective in reducing CO2 emissions in Pakistan between 1975 and 2018.

For non-renewable energy sources, the estimated coefficient on oil consumption is found positive and statistically significant in the long run but insignificant in the short run. Our empirical results show that an increase in oil consumption by 1% increases CO2 emissions by 0.20% in the long run. Since the industrial revolution, the burning of oil has increased exponentially over time, which in turn significantly increase the levels of CO2 in the atmosphere—also considering that CO2 is not only one of the most important air pollutants in the world, but also the most damaging of the environment and human health. For instance, South Africa consumes 640,000 barrels per day (B/d) of oil as of the year 2016, and ranks 29th in the world for oil consumption, accounting for about 0.7% of the world's total consumption of 97,103,871 barrels per day (Ahmad et al. 2021). The extraction and utilisation of oil negatively impact the environment by triggering emissions of CO2 and other greenhouse gases in South Africa. The oil extraction levels of the national companies in South Africa are increasing rapidly, whereby the combustion of this unclean energy resource can be expected to further degrade the environment in South Africa (Musah et al. 2021). Similar results were obtained by Naeem et al. (2021) in which oil consumption is found to increase carbon emissions in Pakistan. This statement was further confirmed by the studies of Kanat et al. (2021) for Russia, Alkhathlan and Javid (2013) for Saudi Arabia, Bimanatya and Widodo (2018) for Indonesia, Das et al. (2016) for India, Rasool et al. 2019 for Pakistan, Tsai et al. 2016 for the United States, and Abokyi et al. (2019) for Ghana, who find that oil consumption deteriorates environmental quality. Our study, however, contradicts the findings of the earlier survey of Lotfalipour et al. (2010) for Iran (using 1967–2007 data), which concluded that there is no long-term bond amid oil consumption and CO2 emissions.

For coal consumption, the estimated long-run coefficient is statistically significant and positive suggesting that the coal energy use considerably intensifies the escalating level of CO2 emissions in South Africa. This reflects the current energy position of South Africa as it ranks seventh largest greenhouse gas (GHG) top in coal consumption, which is in non-renewable energy source (Kanat et al. 2021; Joshua et al. 2020). The coal-driven economy is laudable in South Africa because coal energy use is crucial to support production, and it enhances economic development. Due to substantial reliance on coal energy consumption to produce goods in South Africa, an increase in coal consumption by 1% increases CO2 emissions by 0.81% in the long run. However, there is a need for policy mix by government administrators to match the breaks on the excessive pollutant emission (CO2) from emanating from the exploration of coal. As such, South African energy administrators need to diversify the energy portfolio to renewable energy like biomass, hydro, and solar energy sources (Emir and Bekun, 2019). These results are validated by the empirical contributions of Joshua et al. (2020) and Shahbaz et al. (2013a, b, c), who find that coal consumption has a significant contribution to deteriorate environment in South African economy. Moreover, our results are supported by the study of Magazzino et al. (2020), who confirm that coal consumption deteriorates South African environment. Similarly, our findings coincide with those of Kanat et al. (2021), who observe that higher coal consumption degrades environmental quality by boosting the level of carbon dioxide emissions in Russia over the 1990–2016 period. Adedoyin et al. (2020) assert that a rise in the level of coal consumed results in a simultaneous rise in the CO2 emission figures of those nations under review; thus, the authors allege coal utilisation to hamper environmental well-being. In the context of Turkey, Alola and Donve (2021) conclude that higher coal consumption is detrimental to environmental quality since it is associated with greater emission of CO2. Our findings also agree with those found by Naeem et al. (2021), who observe that coal consumption increases carbon emissions in Pakistan. Finally, our results are contrary to those found by Cheng et al. (2021), who point out that coal consumption and CO2 emissions, at different quantiles of China’s CO2 emission figures, are not causally related.

The estimated short- and long-run coefficients on natural gas consumption are found to be statistically significant and positive, suggesting that a rise in natural gas consumption by 1% brings about an increase in CO2 emissions by 0.11% in the long run, whereas in the short run, a 1% increase in natural gas consumption contributes to deteriorate the environmental quality by 0.13%. As Smajla et al. (2021) illustrated, the importance of natural gas, together with the ongoing liberalisation of the gas market, has made the natural gas sector significantly commercially sensitive. Natural gas consumption however is one of the major energy resources, which has been a major primary input for electricity generation purposes, especially in the developing nations across the globe (Murshed and Tanha 2021). The extraction and utilization of natural gas negatively impact the environment by triggering emissions of CO2 and other greenhouse gasses. Similar results were obtained by Çıtak et al. (2020), who find that natural gas consumption deteriorates environmental quality of the US over the period from 1997 to 2017. Also, our findings coincide with those of Kanat et al. (2021), who observe that higher natural gas consumption degrades environmental quality by boosting the level of carbon dioxide emissions in Russia over the 1990–2016 period. Ummalla and Samal (2019) find also that natural gas consumption plays a key role in escalating CO2 emissions in two major emerging market economies (China and India). Likewise, Etokakpan et al. (2021), who investigated the effect of natural gas consumption on Chinese environment, find that higher natural gas consumption has a significant contribution to deteriorate environment in Chinese economy and an increase in natural gas consumption has a damaging effect and contributes greatly to worsen China’s environmental condition. Our results are contrary to those found by Murshed et al. (2021), who observe that higher consumption of natural gas is seen to abate carbon emissions for Bangladesh. Johnson and Keith (2014) show that low natural gas prices trigger to use more natural gas, which leads to a reduction in CO2 emissions up to 40% in electricity market. Podesta and Wirth (2009) conclude a significant reduction in CO2 emissions because of more usage of natural gas. Also, Joskow (2013) show a great potential of natural gas to reduce GHG emissions in the USA. Similarly, Shearer et al. (2014), who investigated natural gas supply and its impacts on renewable energy and CO2 emissions, point out an interesting result that with firm climate policies, coal use will gradually decline so do CO2 emissions; otherwise, use of natural gas will only delay renewable energy use and not reduce the emissions significantly.

The estimated coefficient for the long run on trade openness (InOPEN) is found to be statistically significant and positive suggesting that an upsurge in trade openness by 1% increases CO2 emissions by 0.18%. The finding is supported by Baek et al. (2009), who suggested that trade is injurious and has extensively contributed to worsen the environmental conditions of developing countries. Our empirical evidence suggests that South Africa’s environmental quality is not supported by openness to international goods market in the long run. This is unlike the short-run result which shows that trade openness can contribute immensely to improve the country’s environment. The long-run detrimental environmental impact of openness in South Africa undeniably reiterates the concern against trade liberalisation. Meanwhile, the type of products forming the bulk of country's exports is part of the possible reason that could explain why trade openness impedes the environment. For instance, since the country has a comparative advantage in export and production of natural resource-intensive goods such forest products, antimony, tin, copper, manganese minerals, phosphates, vanadium, rare earth elements, natural gas, nickel, iron ore, nickel, coal, Chromium, diamond, platinum and gold, a rise in demand of these products will certainly lead to worsening South Africa’s environmental condition. This is because, harvesting them continuously deteriorates the environment. The empirical results are supported by Ngepah and Udeagha (2018); Ngepah and Udeagha (2019); Udeagha and Breitenbach (2021) and Udeagha and Ngepah (2019).

The error correction term (ECT) captures the speed of adjustment. Its estimated value is statistically significant and negative confirming that a steady long-run relationship exists among the variables under review. The ECT estimated value of -0.86 suggests that, in the long run, 86% of disequilibrium is corrected. R-squared value shows that 79% variations in CO2 emissions are brought about by the explanatory variables used in this work. The estimated p value of F-statistics suggests that the model is a good fit.

While keeping other explanatory variables constant, the dynamic ARDL simulations automatically plot the forecasts of actual regressor change and its impact on the dependent variable. The effect of explanatory variables, that is, scale effect, technique effect, hydroelectricity consumption, nuclear energy consumption, oil consumption, coal consumption, natural gas consumption, and trade openness on CO2 emissions is forecasted to increase and decrease by 10% in South Africa.

Figure 1 shows the impulse response plot of relationship between scale effect (economic growth) and CO2 emissions. The plot captures the transition of scale effect and its impact on CO2 emissions. A 10% increase in scale effect denotes a positive effect of economic growth on CO2 emissions in the short run and long run; however, a 10% decrease in scale effect implies a negative influence of economic growth on CO2 emissions, but the impact of 10% increase is higher than 10% decrease in scale effect. This suggests that a rise in scale effect (economic growth) contributes to deteriorate the environmental quality, whereas a decrease in scale effect improves the environmental condition in both the short run and long run in South Africa.

Fig. 1
figure 1

The impulse response plot for scale effect (Economic Growth) and CO2 Emissions. Figure 1 shows a 10% increase and a decrease in scale effect and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

Figure 2 illustrates the impulse response plot of technique effect and CO2 emissions in South Africa. The technique effect graph demonstrates that a 10% increase in technique effect is closely associated with a negative influence on CO2 emissions in the long run and short run. However, a 10% decrease has a positive effect on CO2 emissions in the long run and short run. This suggests that an increase in technique effect (square of economic growth) improves the environmental quality, but a decrease in technique effect deteriorates the environmental condition in both the short and long run in South Africa.

Fig. 2
figure 2

The impulse response plot for technique effect and CO2 emissions. Figure 2 shows a 10% increase and a decrease in technique effect and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

Figure 3 displays the impulse response plot connecting the relationship between trade openness and CO2 emissions. The plot shows that a 10% increase in trade openness positively influences CO2 emissions in the long, but negatively affects it in the short run. In contrast, a 10% decrease in trade openness has a negative influence on CO2 emissions in the long, but positive effect in the short run. This suggests that an increase in trade openness improves South Africa’s environmental quality in the short run, but deteriorates it in the long run. However, a decrease in trade openness has a beneficial impact on South Africa’s environment in the long, but deteriorates it in the short run.

Fig. 3
figure 3

The impulse response plot for trade openness and CO2 emissions. Figure 3 shows a 10% increase and a decrease in trade openness and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

In Fig. 4, the impulse response plot between hydroelectricity consumption and CO2 emissions in South Africa is presented. The graph reveals that a 10% increase in hydroelectricity consumption has a negative influence on CO2 emissions in the long run and short run. However, a 10% decrease in hydroelectricity consumption brings about a positive effect on CO2 emissions in the long run and short run. This suggests that an increase in hydroelectricity consumption improves South Africa’s environmental quality, whereas a decrease in hydroelectricity consumption deteriorates the environmental condition in both the short and long run in South Africa.

Fig. 4
figure 4

The impulse response plot for hydroelectricity consumption and CO2 emissions. Figure 4 shows a 10% increase and a decrease in hydroelectricity consumption and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

In Fig. 5, the impulse response plot between nuclear energy use and CO2 emissions in South Africa is shown. The graph reveals that a 10% increase in nuclear energy consumption has a negative influence on CO2 emissions in the long run and short run. However, a 10% decrease in nuclear energy consumption brings about a positive effect on CO2 emissions in the long run and short run. This suggests that an increase in nuclear energy consumption improves South Africa’s environmental quality, whereas a decrease in nuclear energy consumption deteriorates the environmental condition in both the short and long run in South Africa.

Fig. 5
figure 5

The impulse response plot for nuclear energy consumption and CO2 emissions. Figure 5 shows a 10% increase and a decrease in nuclear energy consumption and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

Figure 6 illustrates the impulse response plot of oil use and CO2 emissions in South Africa. The oil consumption graph demonstrates that a 10% increase in oil consumption is closely associated with a positive influence on CO2 emissions in the long run and short run. However, a 10% decrease has a negative effect on CO2 emissions in the long run and short run. This suggests that an increase in oil consumption deteriorates the environmental quality in both the short and long run in South Africa.

Fig. 6
figure 6

The impulse response plot for oil consumption and CO2 emissions. Figure 6 shows a 10% increase and a decrease in oil consumption and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

Figure 7 presents the impulse response plot of relationship between coal consumption and CO2 emissions. The plot shows that a 10% increase in coal consumption has a positive impact on CO2 emissions in the short run and long run; however, a 10% decrease in coal consumption has a negative influence on CO2 emissions. This suggests that an increase in coal consumption contributes to deteriorate the environmental quality, whereas a decrease in coal consumption improves the environmental condition in both the short run and long run in South Africa.

Fig. 7
figure 7

The impulse response plot for coal consumption and CO2 emissions. Figure 7 shows a 10% increase and a decrease in coal consumption and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

Figure 8 shows the impulse response plot of relationship between natural gas consumption and CO2 emissions. The plot capturing the natural gas consumption impact on CO2 emissions shows that a 10% increase in natural gas consumption has a positive impact on CO2 emissions in the short run and long run; however, a 10% decrease in natural gas consumption has a negative influence on CO2 emissions. This implies that an increase in natural gas consumption contributes to deteriorate the environmental quality, whereas a decrease in natural gas consumption improves South Africa’s environment in the long- and short run.

Fig. 8
figure 8

The impulse response plot for gas consumption and CO2 emissions. Figure 8 shows a 10% increase and a decrease in gas consumption and its influence on CO2 emissions where dots specify average prediction value. However, the dark blue to light blue line denotes 75, 90, and 95% confidence interval, respectively

This work also uses the frequency domain causality test proposed by Breitung and Candelon (2006) to explore the causality between InSE, InTE, InHYD, InNUC, InOIL, InCOAL, InGAS, InOPEN and InCO2 in South Africa. Table 9 shows that InSE, InTE, InHYD, InNUC, InOIL, InCOAL, InGAS, and InOPEN Granger-cause InCO2 in the short, medium, and long run for frequencies \({\omega }_{i}=0.05, {\omega }_{i}=1.50,{\omega }_{i}=2.50.\)This implies that InSE, InTE, InHYD, InNUC, InOIL, InCOAL, InGAS and InOPEN significantly affect CO2 emissions in short, medium and long term in South Africa. Our empirical evidence is compatible with the findings of Udeagha and Ngepah (2019); Ling et (2015) and Saboori et al. (2012).

Table 9 Frequency-domain causality test.

This study further applies the structural stability evaluation of the model to validate its robustness. To this end, the cumulative sum of recursive residuals (CUSUM), and cumulative sum of squares of recursive residual (CUSUMSQ) proposed by Pesaran and Pesaran (1997) are used. Figures 8 and 9 present a visual representation of CUSUM and CUSUMSQ. Conventionally, there is a stability of model parameters over time if plots are within a critical bound level of 5%. Based on the model trend shown in Figs. 8, 9 and 10, since CUSUM and CUSUMSQ are within the boundaries at a 5% level, we can conclude that the model parameters are stable over time.

Fig. 9
figure 9

Plot of Cumulative Sum of Recursive Residuals (CUSUM)

Fig. 10
figure 10

Plot of Cumulative Sum of Squares of Recursive Residuals (CUSUMSQ)

5 Conclusions and policy implications

The energy sector has become the largest contributor to GHG emissions. Among these GHG emissions, most threatening is CO2 emission, which comes from the consumption of fossil fuels. This country-specific study therefore contributes to the existing literature by disaggregating the environmental effects of renewable and non-renewable energy consumption in South Africa over the period 1960–2019. The study uses the recently developed novel dynamic ARDL simulations model proposed by Jordan and Philips (2018) that can estimate, simulate and plot to predict graphs of (positive and negative) changes in the variables automatically as well as their short-and long-run relationships. Using this approach permits us to identify the positive and negative relationships between InSE, InTE, InHYD, InNUC, InOIL, InCOAL, InGAS, InOPEN and InCO2 for South Africa, thereby overcoming the limitations of the simple ARDL approach in earlier studies. For robustness check, we use the frequency domain causality (FDC) approach, the robust testing strategy suggested by Breitung and Candelon (2006) which permits us to capture permanent causality for medium term, short term and long term among variables under consideration. This paper further contributes to empirical literature by employing an innovative measure of trade openness proposed by Squalli and Wilson (2011) to capture trade share in GDP and the size of trade relative to the global trade for South Africa. We use the Dickey-Fuller GLS (DF-GLS), Phillips-Perron (PP), Augmented Dickey-Fuller (ADF) and Kwiatkowski-Phillips-Schmidt-Shin (KPSS) unit root tests. Further, the Narayan and Popp’s structural break unit root test is used since empirical evidence shows that the structural breaks are persistent such that many macroeconomic variables like CO2 emissions, renewable and non-renewable energy sources are affected by the structural breaks.

Empirical evidence from all the tests validated that the data series are integrated into order one, that is, I(1), and there is no evidence of any I(2). SBIC is utilised to identify the optimal lag length. For South Africa, our empirical results reveal that an upsurge in scale effect worsens the environmental condition, whereas an increase in technique effect is environmentally friendly. This empirical evidence implies that the scale effect representing economic growth deteriorates environmental quality, whereas the technique effect has a mitigating effect on the environment. The findings therefore suggest that the EKC hypothesis holds in the case of South Africa, where real income grows until a certain threshold level whereas CO2 emissions start to decline. In the initial stage of economic growth, the environmental quality decreases, whereas after reaching the optimum level, environmental quality starts improving in South Africa. This supports the inverted U-shaped relationship between economic growth and environmental quality. The findings are justifiable for South Africa and associated with structural change and technological advancement in the country. Environmental awareness increases among the people as income grows, so environmental regulations are enforced to use energy-efficient technologies to mitigate pollution.Trade openness deteriorates environmental quality. The FDC results also reveal that InSE, InTE, InHYD, InNUC, InOIL, InCOAL, InGAS, InOPEN Granger-cause InCO2 in the medium term, long term and short term suggesting that these variables are important to influence CO2 emissions in South Africa.

In addition, regarding the environmental effects of individually disaggregated renewable and non-renewable energy consumption in South Africa, our empirical results show that: (i) hydroelectricity reduces CO2 emissions only in the long run; (ii) nuclear energy improves the environment in the long and short run; (iii) oil consumption contributes to deteriorate environmental quality in the long run; (iv) coal consumption worsens environmental condition in the long run; (v) natural gas consumption intensifies the level of CO2 emissions in the long and short run. Therefore, the study confirms that energy consumption is central to a country’s economic development, but some energy resources are harmful to the environment. For South Africa, our results indicate that consumption of renewable energy (hydroelectricity and nuclear) produces less CO2 emissions than non-renewable energy consumption (oil, coal, and natural gas) does. South Africa’s economy is growing fast, but its growth depends heavily on energy consumption. Increased amounts of energy are needed to cater for the increasing demand from the production, household, and transport sectors, but more energy consumption will add more CO2 emissions to the air if South Africa’s existing energy mix remains as it is. To achieve the desired growth rate without harming the environmental quality, policymakers should analyse the country’s energy mix at disaggregated levels. A polluted environment not only has a negative effect on human health but also deteriorates water quality, and agricultural production. South Africa’s government can limit CO2 emissions by shifting from natural gas energy to other alternatives to lower the environmental burden. As Etokakpan et al. (2021) and Murshed et al. (2021) suggested, the government should encourage hydropower activities and more projects should be started to expand the hydropower production. Our results show that consumption of natural gas generates more CO2 pollution than the other energy resources in the country’s energy mix. Even so, natural gas reserves are inadequate, whereas coal reserves are ample, so coal is expected to remain the primary source of energy in South Africa in the future. Recently, South Africa has enormously invested in R&D leading to changes in technology. This has immensely resulted in the paradigm shift from the conventional non-renewable energy sources to renewable energy sources such as hydroelectricity and nuclear energy use, which in turn improve the country’s environmental quality. Also, as part of the major key to mitigate the growing levels of carbon emissions, South Africa has implemented several policies aimed at developing robust technologies important to minimize the intensity of emissions from production processes and other economic activities connected to high levels of emissions.

In light of our empirical evidence, the following policy considerations are suggested: (i) South Africa’s government and policymakers should take further initiatives to ensure the implementation of policies, which enable the change from non-renewable energy sources to renewable ones to promote efficiency in the production processes and curtail CO2 emissions in South Africa; (ii) Since South Africa has many manufacturing industries whose economic activities contribute significantly to increase the country’s levels of emissions, more investments in R&D by government and manufacturing industries will be crucial to further minimise the growing levels of carbon emissions; (iii) South African government should formulate robust policies aimed at imposing high tax brackets on high-polluting industries to force them to adopt clean, greener and updated technologies as well as invest more in R& D, patenting and less-polluting technologies; (iv) A gradual drift from coal-intensive energy which is environmental unfriendly energy that drives a significant part of the South African economy to move to cleaner energy sources such as renewables like wind energy, solar, and photovoltaic energy which are reputed to be cleaner and more eco-system friendly the environment at large; (v) International teamwork to improve environmental quality is immensely critical to solve the growing trans-boundary environmental decay and other associated spillover consequences. In light of this, the government should work together to build robust global teamwork with other countries with the purpose of sharing technology; (vi) The need to reinforce commitment to local and international environment treaties are encouraged for the South African economy in an attempt to set the economy on the path of economic growth. This is because achieving economic expansion will in turn promote the well-being of the South Africans as economic growth means improvement in the standard of living. Thus, this paper suggests that the quest for economic expansion should be carefully managed to minimise environmental decay otherwise in future the negative consequences from economic prosperity will turn out to pose serious environmental danger through degradation which by extension could undue its developmental path; (vii) The government should incorporate comprehensive environmental chapters into the country’s trade agreement policies to enable a transition into low-carbon economy and greener industries, thus encouraging production of cleaner products; (viii) Lastly, trade policy reform could be supported by other developmental policies to ensure long-lasting value for reductions of carbon emissions and continuously enable the development of new technologies that can boost the country’s environmental quality and protect the global environment.

Although the present work has brought about important empirical findings and significant policy considerations in the case of South Africa, one of the major limitations of this work is the use of CO2 emissions as the only proxy for environmental quality. Therefore, further studies should explore other proxies for environmental quality such as ecological footprint, sulphur dioxide emissions, nitrogen oxide emissions and organic water pollutants to provide more understanding for a wider coverage.