Introduction

Urbanization leads to concentrate population and economic activities in urban areas. In recent decades, the world has been urbanizing rapidly. In 1950, only 30% of the world population lived in urban areas, a proportion that grew to 55% by 2018 (UN, 2018). Migration from agriculture to the industrial and services sector creates fundamental changes in natural resources, energy, and the environment (Salim and Shafiei, 2014). Urbanization increases greenhouse gas emissions, and climate change is caused by greenhouse gases (GHGs) (Jiang et al., 2020; Mofijur et al., 2019). GHGs mainly comprise carbon emissions from fossil fuels, accounting for 58% of total emissions (Chen and Hao, 2014). Public–private partnership’s investment in nonrenewable energy is the cause of CO2 emission and degrades the environment in developing countries (Raza et al., 2021). The global energy environment has been rapidly changing since the 1980s after the beginning of the transition phase with the advent of the threats of climate change and declining energy supplies. However, Davidson (2019) finds that CO2 emission is the leading cause of environmental degradation. Energy is an essential aspect of the manufacturing process, and economic growth contributes to improving living standards, which increases energy consumption (Hasanov et al., 2017). Private sector energy investment allocates resources more efficiently and lowers carbon emissions in the atmosphere (Zhao et al., 2018). Globally, fossil fuels dominate energy consumption, contributing to nonrenewable energy sources up to 84% of overall energy consumption (Rapier, 2020). The leading causes of world temperature warming are CO2 emissions, urbanization, and climate change (Shahbaz et al., 2017).

Growth and income inequality nexuses are given by Kuznets (1955), which many researchers have widely used for policy implications. This approach is used in the environment and EG in the perspective of the EKC hypothesis. Several studies have examined environmental sustainability and given many policy implications for environmental protection. To convert agricultural land into urban land, a different form of urbanizing exerts another form of CO2 emission in the environment (Wang et al., 2018). According to Rahman et al. (2015, pp 3), fossil fuel energy consumptions from electricity, minerals, waste, and coal harm the environment; policy implications should be needed for future different types of energy consumption. Wang et al. (2018) discussed that the development of urban areas is causing the growth of CO2 emissions. Empirical evidence suggests that urbanization is a critical stage for developing a country because it is a significant force for shifting its rural base to an urban-industrial base (Davis and Henderson, 2003). Urbanization can cause CO2 emission in the environment (Du et al., 2012). Rapid urbanization in recent decades poses a major danger to the global environment because it increases carbon emissions dramatically (Ali et al. 2019).

Economic activities require energy demand. Consequently, as (economic growth) EG increases, the CO2 emission also increases. Various explanatory variables have discussed the linkage between EG, CO2, and nonrenewable energy consumption, with different independent variables such as FDI, financial development, trade, and population growth (Sebitosi and Pillay, 2008, 2005; Nathaniel and Adeleye, 2021). These studies estimate different periods with different regions and use different control variables. Therefore, their results conflict with each other. Further, in African countries, their primary source of energy is nonrenewable energy, which causes environmental degradation (Awodumi and Adewuyi, 2020). It is imperative to discuss and analyze the impact of urbanization and economic growth on CO2 emission. Many studies have addressed the environment with energy consumption and economic growth in developing countries, inclusive of Africa. But the impact of urbanization on the environment in African Union countries has been ignored in the previous literature. Little empirical literature has been established. Therefore, this study is delineated to address this specific issue.

Many empirical works discussed CO2 emission in a stretch of fossil fuel energy source and economic growth (Hanif and Gao-de-santos, 2017; Nasreen et al., 2017; Song et al., 2008; Kahuthu, 2006; Diao et al., 2009; Liu et al., 2007; Wang et al., 2016a, 2016b; Fodha and Zaghdoud, 2010). So we use fossil fuel energy as nonrenewable energy. Recently, many economies have been linked to one another. Particularly culturally, socially, economically, and politically, this is because advanced information systems are possible through urbanization. Transfer of technology through FDI to advanced countries to fewer technologically for low developed countries. Thus, urbanization is vital that EG be determined. This enhances economic activities due to its crucial role. In contrast, the increasing demand for goods and services increases the energy demand worldwide. Magazzino et al. (2021) discussed the linkage between economic growth and energy consumption as the central theme of the economics literature. The investigation provides both energy and environmental sustainability growth of implications.

The African Union was founded in 2002. They have 55 African members’ countries. In previous studies, there is a gap in investigating urbanization and environmental degradation in the African Union. The deficiency of previous studies makes the following contribution, urbanization, and environmental degradation nexus, including nonrenewable energy consumption and economic growth. Various studies discussed the relationship between urbanization and the environment in terms of CO2 emission. In most African Union countries, their primary source of producing energy is electricity and heat production and mostly depends on fossil fuels. Beyond the fact, the topic is essential because the empirical literature on the linkage between nonrenewable energy consumption and CO2 emission has been broadly discussed.

This study examines the relationship between urbanization and nonrenewable energy on carbon emission in Africa. The investigation revisits both energy and environmental sustainability growth of implications with different econometric techniques. The topic is more important and novel because we discuss African Union countries. Previous studies used limited African countries and used time series data. We used panel grouped data and used 54 African countries, which are listed in the African Union with current fresh data. However, the specific objectives of this paper are as follows:

  • To explore the heterogeneous effect of urbanization and nonrenewable energy on carbon emission in the African Union

  • To explore how nonrenewable energy consumption effect environmental degradation in the African Union in the long run

  • To explore whether African Union countries reveal environmental Kuznets curve (EKC) and illustrate the economic growth and CO2 emission hypothesis

To achieve the first objective, we utilize the panel quantile regression (PQR) analysis by Koenker (2004) to investigate the heterogeneous effect of urbanization and nonrenewable energy consumption on CO2 emission in African Union economies. For the second objective, we utilize a fully modified ordinary least squares (FMOLS) estimation model. In this regard, few studies discussed the relationship between urbanization and environmental degradation in Africa (Hanif, 2018; Ssali et al., 2019). For the third objective, we employ the EKC hypothesis (Kuznets, 1955).

Our study is described in the following section. The “Literature review” section discusses the related literature on urbanization, nonrenewable energy consumption, CO2 emission, and economic growth. The third section shows the “Data and methodology” section, and the “Results” section is about the results and discussion followed by policy implications and conclusion.

Literature review

Over the last two decades, the literature has shown a connection between nonrenewable energy consumption, CO2 emissions, and economic growth. In recent years, there has been a significant increase in the reliability of the EKC model. Growth environmental nexus can be described as inverted U-shaped EKC. Grossman and Krueger (1991) define three stages of environmental quality. This curve defines the nexus of the environment. The author used the EKC hypothesis curve to estimate the North Atlantic Free Trade Agreement. Many researchers used this approach to investigate the climate and EG effect with different variables (Ma et al., 2021; Bilgili et al., 2016; Liu et al., 2017). Rahman et al. (2015) find a negative causality between energy consumption and GDP growth and positive relationship to CO2 emission. Energy consumed by nonrenewable has a high correlation with economic growth. It is deteriorating the environment’s quality that is the most influential climate change, deforestation, and depletion of natural resources. A lot of literature discussed the urbanization and CO2 emission in different regions of the world, such as the African region (Al-Mulali et al. 2013), for Turkey (Katircioğlu and Katircioğlu 2017), for developed economies (Liddle and Lung 2010), for Malaysia (Suki et al. 2020), for developing countries (Martínez-Zarzoso and Maruotti 2011), for Japan (Ouyang and Lin 2017), for the USA (Dogan and Turkekul 2015), and for the UK (Baiocchi et al. 2010). Some used the environmental Kuznets curve hypothesis and found the inverted U-shaped curve (Pata, 2018; Xiangyang and Guiqiu, 2011; He et al., 2017; Zhu et al., 2012). Some researchers reveal no significant relationship between urbanization and CO2 emission (Du et al., 2012; Sharif Hossain, 2011; Sadorsky, 2014). Ma et al. (2021) analyzed data from 1995 to 2015 of France and Germany. The authors find inverted U-shaped EKC hypothesis exists between CO2 emission and real GDP. From the perspective of four ASEAN countries from 1970 to 2013, the results do not support the inverted U-shaped EKC hypothesis in the long run (Liu et al., 2007). Bilgili et al. (2016) analyzed 17 OECD countries from 1977 to 2010. They used dynamic ordinary least squares (DOLS) and FMOLS econometric techniques. Environmental Kuznets curve hypothesis exists in the model. They find an inverted U-shaped relationship between CO2 emission, income per capita, and income per capita square.

The literature discusses the African countries as a subsample, and the findings are not identical. They have different results with different econometric techniques (Oppong et al., 2020; Boutabba et al., 2018; Sebitosi and Pillay, 2008, 2005; Nathaniel and Adeleye, 2021). Studies analyzed the linkage between nonrenewable energy and economic growth (ben Aïssa et al., 2014; Rafindadi and Ozturk, 2017; Inglesi-Lotz, 2016; Apergis et al., 2010); they conclude that economic growth and nonrenewable energy have a two-way relationship in the short and long run. He (2019) examines the energy and economic growth relationship in Malaysia from 1978 to 2013 and concludes that economic growth causes environmental pollution. Soava et al. (2018) estimated a panel dataset of 28 European Union nations and found that renewable energy significantly improves the economic growth. Cho et al. (2015) investigate 31 OECD countries and indicated a one-way relationship between nonrenewable energy and economic growth. Economic activities contribute to environmental pollution. Aydin (2019) estimated data from 1980 to 2015 of 26 OECD nations and found economic growth causes of environmental degradation.

Asongu et al. (2019) estimated 40 African countries from 2002 to 2017. They used fixed effect and quantile fixed effect regression for analysis. They concluded that renewable energy consistently reduces carbon emission in the atmosphere. Adewuyi and Awodumi (2020) analyzed South Africa and Nigeria from 1981 to 2015 using a simultaneous equation model and threshold regression analysis. They concluded that CO2 emission increases as petroleum import increases in both countries. Sarkodie (2018) estimated 17 African countries from 1971 to 2013 using fixed effect and random effect techniques. They confirmed the validity of EKC hypothesis in African sample countries. Hanif (2018) estimated sub-Saharan countries from 1995 to 2015 using GMM estimation. He concluded that the EKC hypothesis exists in lower-income sub-Saharan Africa. Attiaoui et al. (2017) estimated 22 African countries from 1990 to 2011 using the PMG model. They concluded that nonrenewable energy consumption increases the carbon emission in the atmosphere, whereas renewable energy consumption reduces the carbon emission. The study of Musah et al. (2020) estimated the West African Zone from 1990 to 2018. They utilized CCEMG technique and confirmed that there is no vital effect of renewable energy consumption on GDP. The results also confirmed there is no effect of urban population on GDP in sample countries. Ssali et al. (2019) estimated six selected sub-Saharan countries from 1980 to 2014. The authors confirm the EKC hypothesis, and there is a positive linkage between energy consumption and economic growth in the long run.

However, Fakher (2019) find that energy consumption, economic growth, and population are the leading cause of environmental degradation in OPEC countries. Destek and Sinha (2020) examine the link between energy consumption, trade, and EG by using 24 OECD countries. They used FMOLS, DOLS, and CCEMG techniques and find that nonrenewable energy causes environmental degradation and renewable energy reduces environmental degradation. In contrast, renewable energy consumption is critical for reducing CO2 emission and boosts economic growth, so the relationship between these variables was investigated by Apergis et al. (2010), Adewuyi and Awodumi (2017), and Lee (2013). Ajmi et al. (2015) examine G7 countries and conclude that the EKC hypothesis does not support their findings. The authors Baz et al. (2021) estimated data of Pakistan from 1980 to 2017 and find a positive relationship between fossil fuel energy and economic growth. Zheng et al. (2014) estimated China data from 1998 to 2010 by using dynamic spatial panel analysis. Their findings confirmed that GDP growth and CO2 emission in China have a positive relationship. Jaunky (2011) used the data from 1980 to 2005 and used GMM and VECM for estimation. His findings verify the presence of the EKC hypothesis in 36 high-income countries.

The income and environmental relationship are discussed by many researchers from the perspective of the EKC hypothesis. These analyses support the EKC hypothesis with different frameworks. EKC hypothesis was analyzed with different variables under the assessment of economic growth and GHG emission (ben Jebli et al., 2016; Apergis and Ozturk, 2015; Al-Mulali et al., 2016). Some authors contradict with EKC hypothesis. They find a positive linkage between economic growth and CO2 emission (He and Richard, 2010). Zoundi (2017) has analyzed 25 African countries from 1980 to 2012, and he used OLS, GMM, and pooled mean group for estimation. He concluded a positive link between income and carbon emission. The study of Kearsley and Riddel (2010) failed to justify the EKC hypothesis and suggested a positive association between income and economic growth. Similarly, Sinha et al. (2017) find no noticeable link between economic growth and carbon emission. They also confirm that there is no inverted U-shaped hypothesis in the region. The curve is N shape in N11 countries. In the case of Latin America, Culas (2007) finds the EKC hypothesis. Table 1 represents a brief literature review on EKC hypothesis.

Table 1 EKC hypothesis literature

In 20 sub-Saharan countries, Tenaw and Beyene (2021) analyzed the ARDL model and confirmed the inverted U-shaped EKC hypothesis. Apergis et al. (2017) estimated data from 1960 to 2010 from the USA. Carbon emission is used as a proxy for environmental quality. The study verifies the inverted U-shaped EKC hypothesis. Traditional studies tested energy consumption and GDP growth with a total effect of energy on growth (Apergisd and Payne, 2009; Pao and Tsai, 2010; Shahbaz et al., 2013). Now literature exchanges energy consumption to renewable and nonrenewable energy (Maji et al., 2019; Shahbaz et al., 2015; Zafar et al., 2019). Similarly, Álvarez-Herránz et al. (2017) indicates that R&D in energy and carbon emission in 28 OECD countries from 1990 to 2014. The author used the environmental Kuznets curve and found that innovation in the energy sector negatively affects CO2 emission. Furthermore, Ganda (2018) explores the determinant of CO2 emission in OECD countries using GMM estimation and finds that investment in renewable energy improves the atmosphere environment and lowers CO2 emissions. Moreover, Waqih et al. (2019) estimated data from 1986 to 2014. The study examined private investment and CO2 emissions in SAARC countries. The results reveal that CO2 and private investment have a U-shaped relationship. Balsalobre-Lorente et al. (2019) analyzed data from 1995 to 2016 and concluded that the public’s investment in energy is significantly associated with the environment in OECD countries.

Data and methodology

Data

This research emphasizes the importance of urbanization and nonrenewable energy consumption on CO2 emission in African Union countries from 1996 to 2019. The concerning data of all variables are extracted from WDI (World Bank, 2021). We used CO2 emission as a proxy of environmental pollution and used it as a dependent variable. The independent variables are GDP per capita, GDP per capita square, fossil fuel energy consumption, and urbanization. We used fossil fuel energy consumption used as proxy of nonrenewable energy. GDP square is utilized to estimate the EKC hypothesis in the African Union.

Methods

Because of the globalization and association of the world economies, cross-sectional dependence (CSD) often occurs in panel results. This problem is caused by a combination of local and foreign shocks and hidden components. If we neglect CSD, we might have inefficient and inconsistent regression results. Therefore, we initiate the analysis by conducting Pesaran’s (2004) CSD test. Unit root based on first generation cannot consider CSD. So to estimate the stationary of variables, we use the cross-sectional augmented Dickey-Fuller (CADF) test and cross-sectionally augmented Im-Pesaran and Shin (CIPS) test (Pesaran, 2007). The regression equation of CADF is as follows;

$$\begin{array}{cc}{y}_{it}=\left(1-\varphi \right){\mu }_{i }+ {\varphi }_{i}{y}_{i,t-1}+ {u}_{it },& i=1,\dots ,N;t=1,\dots .,T, {u}_{it }= {U}_{i }{f}_{t }+ {\varepsilon }_{it}\end{array}$$
(1)

Here, i represents observation number, t presents time period, \({\upmu }_{i}\) error term, \({f}_{t}\) unobserved comment effect, and \({\varepsilon }_{it}\) represents individual-specific error.

CIPS indicate the average panel though the CADF unit root test, which are obtained by mean value of all cross-sectional units.

$$\mathrm{CIPS }\left(\mathrm{N},\mathrm{ T}\right)=\mathrm{t}-\mathrm{bar}=\mathrm{N}-1\sum\nolimits_{i=1}^{N}ti \left(N, T\right)$$
(2)

In the above model, ti (N, T) represents the Dickey-Fuller statistic of the \({y}_{i,t-1}\) coefficient in the CADF regression.

Though Pesaran (2007) CADF and CIPS check for stationary and also analyze the panel data heterogeneity. In current literature, CADF and CIPS are standard techniques that address the issue of heterogeneity but also control CSD.

To check the long-term cointegration between variables, we use Pedroni (2004), Kao (1999), and Westerlund and Edgerton (2008) cointegration test. For checking the heterogeneous effect of variables, we use panel quantile regression. To investigate the long-run relation between the variables, we use FMOLS estimation.

Panel quantile regression

This study is based on panel quantile regression by Koenker (2004) to check the heterogeneity in the panel data. Panel quantile regression is very famous nowadays and widely used in the experiment on environmental research. In previous studies, the traditional way of regression analysis is used. It measures the average covariate effect on observed variables that cause regression coefficients to be inaccurate. Quantile regression is more reliable because it also captures and eliminates all major differences between expected and observed variables on the inaccuracy of regression coefficients. Panel quantile regression analysis helps us for the conditional distribution of economic growth and nonrenewable energy. A similar paper uses quantile regression to estimate growth (Singh and Kannadhasan, 2020; Akram et al., 2021). The conditional quantile regression is defined as follows:

$${Q}_{CO2i}\left(\tau |{x}_{i}\right)={x}_{i}^{\tau }{\beta }_{\tau }$$
(3)

In this paper, we use quantile regression for individual unobserved heterogeneity. One reason for the inadequate literature quantile regression is the infeasibility to wipe out unobserved in the model. Koenker and D’Orey (1987) suggest overcoming this issue. The estimator depends on diminishing a weighted amount of K ordinary quantile regression function corresponding to the K value compared to K of τ. The coefficient of τ is dependent and independent, respectively. The parameters’ equations are written as follows:

$$\underset{(\alpha ,\beta )}{\mathrm{min}}\sum_{k=1}^{K}\sum_{t=1}^{T}\sum_{i=1}^{N}{w}_{k}{\rho }_{\tau k}\left({CO2}_{it}-{\alpha }_{i}-{X}_{it}^{T}\beta \left({\tau }_{k}\right)\right)+\lambda \sum_{i}^{N}\left|{\alpha }_{i}\right|$$
(4)

where i is the index for countries and T is the number of observations for countries. K is the quantile for indexing, x is the matrix of independent variables, \({\rho }_{{\tau k}}\) is the loss of quantile, and \({w}_{\mathrm{k}}\) is the given weight corresponding to kth quantile. CO2it represents the carbon emission level. The term λ is the penalty parameter which improves the estimate of β by minimizing individual effects to zero. To explain in function form

$${Q}_{lnCO2i}\left(\tau |{{\alpha }_{i}, x}_{i}\right)={\alpha }_{i}+{\beta }_{1\tau }{lnGDP}_{it}+{\beta }_{2\tau }{\mathrm{ln}{\left(GDP\right)}^{2}}_{it}+{\beta }_{3\tau }{lnNR}_{it}+{\beta }_{4\tau }{lnURB}_{it}$$
(5)

Here \({Q}_{lnCO2i}\left({\tau |{\alpha }_{i}, x}_{i}\right)\) refers to the τth quantile of log CO2 emission, and \({\alpha }_{i}\) indicates the unknown specific country effects. \({x}_{i}\) refers to vector of exogenous variables. GDP refers to gross domestic product current US dollar, and we use GDP squares to investigate the EKC hypothesis in African Union countries. NR refers to nonrenewable energy consumption, and URB refers to urbanization. i denotes the country and t denotes the year. We use natural log values of all variables to level the data. The log transformation simplifies the interpretation of the estimated coefficients in terms of their elasticity.

This study utilized the EKC hypothesis Kuznets (1955) to check the influence of urbanization in nonrenewable energy consumption on CO2 emission. The environmental degradation nexus in the perspective of the EKC hypothesis. Grossman and Krueger (1991) follow the Kuznets and describe the environmental quality growth nexus. The authors discussed that environmental quality was significantly reduced by attempting to achieve highest economic growth in the first stage. Beyond this first stage, the fundamental objective of the economies is to achieve long-term economic growth and welfare through technical innovation (clean environment-friendly technology) and the development of environmental regulations to reduce CO2 emissions (Grossman and Krueger, 1991). As a result, after attaining the highest level of GDP per capita, nations seek to transition from bad environmental circumstances to a clean environment to achieve long-term economic growth. Various policymakers and academics have employed the study of EKC hypotheses about incomes, pollution, and other important factors in a GDP square function. Chang et al. (2018) used quantile regression in 65 developed and developing countries and concluded that nonrenewable energy consumption and carbon emission have a positive relationship. Boamah et al. (2017) used quantile regression and revealed that nonrenewable energy worsen the environment quality by promoting carbon emission in China. Sharif Hossain (2011) studied that energy consumption harms the environment. According to Perera and Lee (2013), energy consumption leads to producing combustion products that pollute the environment, and these combustion products also release solid and wastewater which cause carbon emissions.

Fully modified ordinary least square (FMOLS)

For the estimation of the long-run elasticity of the coefficients, we utilize FMOLS. In the estimation of the coefficients in panel data form, the FMOLS exhibited its ability to manage endogeneity and serial correlation. The panel FMOLS estimators (Pedroni, 2004) in mathematical expression can be written as:

$$\widehat{B}*\mathrm{ GFM}={N}^{-1}\sum\nolimits_{i=1}^{N}\widehat{B} *\mathrm{ FM},\mathrm{ i}$$
(6)

The FMOLS estimator for ith country is \(\widehat{B}\) * FM, i and the corresponding t-statistic is:

$${t}_{\widehat{B} *\mathrm{ GFM}}{=N}^{-1}\sum\nolimits_{i=1}^{N}\widehat{t}\mathrm{ B}*\mathrm{ FM},\mathrm{ i}$$
(7)

According to Harris and Sollis (2003), FMOLS is a non-parametric method for dealing with serial correlation corrections.

The above methodology is used to confirm the non-stationary, stationary, and slope of heterogeneity.

Results

To ensure the accuracy of our analysis, prior to running the formal empirical analysis, we checked the multicollinearity problem among the variables. We used variance inflation score (VIF). Their finding of the mean value of VIF score is 2.64% which is below 10%, as a benchmark in the econometric that indicates data is free from multicollinearity issue. Further, we check the heteroscedasticity issue using the Breusch-Pagan test, and its p-value (0.88) is greater than 5% level of significance which confirms the heteroscedasticity problem is not present in the data. We use CSD, panel unit root test, and cointegration test used for long-term relationships between variables. Then we use quantile regression analysis to check the significance by different levels of quantiles. To analyze the long-run association, we use (fully modified ordinary least square) FMOLS. Table 2 provides the descriptive statistics and description of variables.

Table 2 Descriptive statistics and description of variables

CSD and panel unit root test

To check the stability of our unit root test, we analyze the CSD test. Table 3 shows CSD results. The sample of African Union countries suggests that the null hypothesis of no CSD is successfully rejected. Pesaran (2007) CADF is a second-generation unit root test that takes the presence of cross-sectional dependence into account. CADF test statistics could be calculated for each cross-section, and CIPS statistics could be calculated for the panel average. The CADF unit root test could be administered in cases where the time dimension is greater than the cross-sectional dimension or the other way around. Table 4 shows that the panel unit root test (CIPS and CADF) series are stationary at the level and first difference. All variable effects of CSD are supported by the use of quantile regression for additional estimation. However, the findings show that CSD is present in the panel. These results rejected the null hypothesis, indicating that all variables are stationary at the level and first difference.

Table 3 Cross-sectional dependence test
Table 4 Unit root test

Panel cointegration test

After the unit root test has been analyzed, Pedroni (2004), Kao (1999), and Westerlund and Edgerton (2008) panel cointegration tests are applied to examine the cointegration between variables. Table 5 shows the cointegration test. Pedroni test results of within dimension and between dimensions. Seven out of four are significant, confirming that cointegration exists between the variables. Kao t-statistic value (− 5.1210) with p-value (0.000) also establishes a long-term relationship between variables. The Westerlund and Edgerton (2008) panel cointegration test shows that urbanization, nonrenewable energy, and carbon emission are cointegrated at 1%.

Table 5 Panel cointegration test

Panel quantile regression (PQR)

This section explains the heterogeneous effect of urbanization, GDP, GDP square, and nonrenewable energy on CO2 emission. This study uses five quantile regression results to check the effect of EKC hypothesis. It has a diver’s effect of dependent and independent variables. PQR analyses give the different slopes of various quantiles and measure the hidden heterogeneity of each cross-section (Amin et al., 2020). The results are explained in Table 6, and Fig. 1 explains the heterogeneous effect of log values of GDP, GDP squares, NR, and URB on CO2 emission of African Union countries.

Table 6 Results of quantile regression
Fig. 1
figure 1

Quantile regression coefficients, X-axis shows the different quantile levels of the dependent variable of lnCO2. Y-axis describes the coefficient of independent variables (lnGDP, lnGDP2, lnNR, lnURB). OLS estimation results are shown by red line and confidence interval 95% is shown by the blue line. The black line shows the quantile coefficient of PQR, and a gray area is the 95% confidence interval of PQR coefficient

In previous studies, the traditional way of regression analysis was used. It measures the average effect of covariates on observed variables that causes regression coefficients to be inaccurate. Quantile regression is more reliable because it also captures and eliminates all major differences between expected and observed variables on the inaccuracy of regression coefficients. Figure 1 explains these variables’ relationship. According to the results, GDP in lower quantiles (5th and 25th) results are negative and insignificant. In the upper quantile (50th, 75th, and 95th), GDP and CO2 are positively significant. This means higher GDP countries increase the CO2 emission, and the impact of environmental deterioration is high in high-income countries. GDP square is negatively significant in upper quantiles, which confirms the EKC hypothesis. In higher-income countries, EKC exists. When economic growth increases at first, CO2 emission increases, but after the threshold point, when economic growth increases, environmental degradation decreases (Kuznets, 1955). This curve is an inverted U-shape. The outcomes of high-income countries are the major causes of the rise in pollution in African Union countries. Nonrenewable energy and CO2 emission have a positive relationship in all quantiles. Nonrenewable energy causes CO2 emission in lower and upper-income countries. Similarly, urbanization has no impact on CO2 emission in lower-income countries but positively significant in upper quantile. In upper-income countries, as urbanization increases, environmental pollution is also increasing.

FMOLS full sample

Table 7 shows the results of the FMOLS full sample. According to the outcome, GDP is positively significant with CO2 emission. With a 1% increase in GDP per capita, the CO2 emission will increase approximately by 0.32%. GDP square is negatively significant with CO2. With a 1% increase in GDP square, the CO2 emission will reduce by 0.18% approximately. These results confirm the presence of the EKC hypothesis in the perspective of African Union nations. These outcomes demonstrated by Ma et al. (2021), Bilgili et al. (2016), and Liu et al. (2017) verify that at the early stage of development, environmental pollution is increasing, but after the threshold point, EG is increased, and the environmental pollution is decreasing. Nonrenewable energy and CO2 emission have a positively correlate with a 1% increase in nonrenewable energy environmental pollution increase by 0.86% in African union countries. These empirical findings support our results (ben Aïssa et al., 2014; Rafindadi and Ozturk, 2017; Inglesi-Lotz, 2016; Apergis et al., 2010). Urbanization and CO2 emission also have a positive linkage, a 1% increase in urbanization environmental pollution will increase by 0.22% in sample countries. This finding is equal to Tang et al. (2021), Hashmi et al. (2021), Yao et al. (2021), and Zhang et al. (2021). Figure 2 represents the bivariate relationship between these variables.

Table 7 Results of FMOLS
Fig. 2
figure 2

Bivariate relationship between lnNR, lnURB, lnGDP, and lnCO2 for African Union countries

The findings indicate a strong positive relationship between urbanization and nonrenewable energy on carbon emission in African Union countries.

Discussion of results

This study investigates the linkage between nonrenewable energy, economic growth, urbanization, and CO2 emission under the EKC framework. Pedroni, Kao, and Westerlund cointegration were used for the long-term association between the variables. Quantile regression analysis shows that at 5th quantile, GDP decreases as CO2 increases, and GDP square increases as CO2 increases; both have a positive and significant relationship. This outcome shows the U-shaped relationship exists in lower-income countries of Africa. At 25th quantile, GDP and GDP squares are insignificant. These outcomes show no effect of GDP on CO2 emission. At 50th quantile, GDP and CO2 are positive and significant, but EKC hypothesis does not exist. At upper quantiles (75th and 95th), EKC hypothesis exists. This curve is an inverted U-shape. According to the results, high-income countries are the major causes of the increase of pollution in African Union countries. Nonrenewable energy consumption and CO2 emission have a positive and significant relationship throughout all quartiles. This outcome shows nonrenewable energy consumption increases environmental pollution in African Union countries. From quantiles (5th to 50th), there is no significant impact between urbanization and CO2 emission. In upper quantiles (75th–95th), urbanization and CO2 emission have a positive and significant relationship. This result confirms that urbanization increases environmental pollution in higher-income countries. Fully modified OLS estimation reveals that nonrenewable energy, economic growth, and urbanization increase environmental pollution in African Union countries. Furthermore, fossil fuel energy increases the CO2 emission in the atmosphere. This study highlights the environmental issues in African Union countries and gives the information for future plans and recommendations to the institutions to reduce environmental pollution in the region. Studies that discussed the EKC hypothesis with different variables with different regions are Renzhi and Baek (2020), Al-Mulali et al. (2015), Wang et al. (2016a, 2016b), Suki et al. (2020), Sarkodie and Strezov (2019), Ajanaku and Collins (2021), and Xu et al. (2020); these studies included economic growth with pollution, energy effectiveness, financial development, and GHG relationship concerning the EKC hypothesis. Their findings confirm that economic growth increases GHGs in the atmosphere. Alhassan (2021) has also tested the EKC hypothesis in 38 African countries and found that urbanization increases CO2 emissions and confirms EKC does not exist in African countries. In recent years several studies discussed nonrenewable energy is the leading cause of environmental degradation. Environmental degradation occurs with the combustion of fossil fuels. Economic growth and nonrenewable energy cause the CO2 emission; the existing studies well describe it in different regions, Koengkan et al. (2019) for Latin America, Bekun et al. (2019) for 16 European Union countries, Long et al. (2015) for China, Ardakani and Seyedaliakbar (2019) for MENA countries, Boontome et al. (2017) for Thailand, and Sarkodie and Strezov (2018) for Australia. So African Union should focus on this matter to reduce CO2 emissions. According to the IAEA (2021), the climate change goal will be met in 2050 to produce 90% of energy by low CO2 emission. In the African Union, there is a need to make policies to overcome environmental degradation.

Policy implication

Based on the results of the study, numerous policy implications for Africa were recommended, as nonrenewable energy bring environmental pollution that affects pregnant women, children, and the entire population. Therefore, Africa needs to change from nonrenewable energy supply to a renewable energy supply such as solar energy and wind energy. Urban planning actions should be taken with the joint cooperation of urban zoning authorities, energy and transportation planners, housing authorities, and municipal service providers. In this case, Africa will be free from climate change effects and environmental degradation. This will bring what is called green economic growth in the region. In addition, there is a need for the continent to hold carbon storage and taking techniques to decouple pollutant emissions from the growth of the economy on the continent economic growth path. Henceforth, this empirical finding will help Africa to understand the nexus between the impact of nonrenewable energy, urbanization, and environmental pollution. The policymakers, stakeholders, and government administrators should be aware of the impact and should help to draw the blueprint for the continent. This finding will help Africa’s continent be aware of the international treaties to intensify its commitment on climate finance and free environmental pollution like the Paris Agreement and Kyoto Protocol submission. This is in a bid to cut the emissions of carbon dioxide in the African space. Finally, the need to switch to other cleaner and environmental-friendly energy sources like solar energy, biomass, and hydro energy is encouraged in Africa.

Conclusion

In this study, we analyze the urbanization and nonrenewable energy on carbon emission in Africa to have insight into the problems the continent face to stick to nonrenewable energy consumption and how we can have a solution and prepare to specify a blueprint for the continent to shift to renewable energy consumption. The current study explores the nexus between the variables above within a balanced panel data over selected African countries from 1996 to 2019. The Kao, Pedroni, Westerlund, and Edgerton cointegration tests show cointegration among the variables under consideration. In this regard, the study confirmed some links between CO2 emission, nonrenewable energy, urbanization, and economic growth. First, the results demonstrate that nonrenewable energy and economic growth have a significant impact on CO2 emissions. Second, the FMOLS technique is used to estimate the EKC hypothesis, and the outcome indicates that urbanization, economic growth, and nonrenewable energy are the leading cause of increasing CO2 emissions in the atmosphere. Finally, the authors recommended Africa continents, even though the 54 countries selected will have different heterogeneity issues and unobserved factors such as political situation, energy price, macroeconomic factors, rule of laws, different corruption levels, and debt levels. With all these, we recommend that the Africa continent take serious law and build a proposal for the blueprint for the African continent to have efficient and effective energy production and consumption. This is to say to achieve green growth in Africa. The only solution is for the continent to shift from fossil fuel energy supply to renewable energy supply.