1 Introduction

The concept of market efficiency, pioneered by Fama (1970), has been a fundamental aspect of financial theory. A market is defined efficient if past prices are fully reflected on the current price, resulting in an optimal allocation of scarce capital resources (Fama 1970; Lim et al. 2008a, 2008b). The Efficient Market Hypothesis (EMH) indicates that future prices follow a random walk and are modeled through a stochastic process. Supported by the behavioral finance hypothesis, previous studies challenge the EMH's unrealistic assumptions and the existence of profitable strategies to beat the market (De Bondt and Thaler 1985; Lakonishok et al. 1994; Shi and Zhou 2017; Shleifer 2000). Another criticism pertains to a static market efficiency (Ghazani and Araghi 2014). To address these criticisms, Lo (2004, 2005) proposes the Adaptive Market Hypothesis (AMH) which aims to reconcile the behavioral finance with the EMH in a coherent manner. The AMH advocates for an evolutionary approach, acknowledging an evolving market efficiency (Lim and Brooks 2011). The adaptation to innovation and natural selection can lead to a time-varying market efficiency due to fundamental changes in market conditions (Lo 2005). AMH studies have explored the stock return predictability and ranked markets according to their relative efficiency levels in both developed (Zebende et al. 2022; Choi 2021; Ozkan 2021; Okorie and Lin 2021; Mensi et al. 2019) and emerging markets (Hirmath and Narayan 2016; Al-Khazali and Mirzaei 2017; Gyamfi 2017; Chang et al. 2023).

More interestingly, identifying the drivers of stock market efficiency is of paramount importance for portfolio managers, policymakers, and regulatory authorities. The empirical studies have tested the EMH using various statistical tests (Escanciano and Lobato 2009; Ghazani and Araghi 2014; Kim et al. 2011a; Ghazani and Araghi 2014). Additionally, another strand of empirical studies has examined the stock price predictability over time by relying on the role of macroeconomic variables (Baltratti et al. 2016; Easley and O'Hara 1992), interest rates (Gay 2008), turnover (Barber and Odean 2000), market volatility (Hameed et al. 2006), investor sentiment (Baker et al. 2016), and market liquidity (Amihud 2002; Linton 2012; Danyliv et al. 2014; Sarra and Lyberk 2002; Stoll 1984). However, these studies fail to identify whether the underlying factors affects the pattern of stock market efficiency.

This paper aims to address this gap in the literature by examining the key drivers of stock market efficiency. To the best of our knowledge, this is the first study to analyze the impacts of macroeconomic factors (exchange rates [EXCHG], 3-month Treasury bills [INTER], Europe Brent crude oil prices [OIL]), microstructure factors (market liquidity [LIX] and market volatility), uncertainty indexes (the economic policy uncertainty index [EPU] and the Composite Leading Indicator [CLI]), sentiment factors (Sentiment Endurance index [SE] and Consumer Confidence Index [CCI]), and global shock factors (2008 global financial crisis [GFC] and COVID-19 pandemic [COVID19]) on the dynamic efficiency of stock markets of G7 economies, namely Canada, France, Germany, Italy, Japan, UK, and US.

Using the augmented mean group (AMG) estimator and heterogeneous panel causality method, our results show that both oil price changes and COVID-19 outbreak contribute to the inefficiency of G7 stock markets. Moreover, the causality test results exhibit a significant unidirectional causality from both oil prices and COVID-19 pandemic to market efficiency. Furthermore, we find a significant bidirectional causality between time-varying market efficiency and various factors, including interest rates, exchange rates, market volatility, Economic Policy Uncertainty and the Composite Leading Indicator. These findings shed light on the driving forces that influence stock market efficiency.

This study contributes to the existing literature in different fronts. First, it provides a comprehensive analysis on the dynamic efficiency of G7 stock markets during different turbulent periods. Second, it extends the TV-AR approach of Ito et al. (2014, 2016) to estimate time-varying stock market efficiency. This approach provides a more accurate assessment than the traditional statistical tests based on the rolling window method (Noda 2016). Third, it explores the dynamic relationships between potential macroeconomic ad microeconomic factors and stock market efficiency, bridging the gap in the existing literature, which often overlooks the effects of macroeconomic and firm-specific variables on stock market efficiency. Our investigation considers five important groups of driving forces affecting stock market efficiency namely macroeconomic, microstructure, uncertainty, sentiment, and global shock factors.

We notice that our investigation has important practical implications for both regulatory authorities and investors. The former gains a better understanding of the key drivers of market behavior and efficiency which help to implement the appropriate regulations to enhance the stock market efficiency (Antoniou et al. 1997). The latter can effectively track arbitrage opportunities and exploit them until an equilibrium is established.

The remaining paper is structured as follows. Section 2 presents the literature review and hypothesis formulation. Section 3 outlines the variable descriptions and Sect. 4 presents the empirical design. Section 5 reports and discusses the empirical results. Section 6 concludes the paper.

2 Literature review and hypothesis development

While a large body of existing literature has focused on the effects of macroeconomic variables on stock market returns and volatility, limited studies have explored the determinants of stock market efficiency.

2.1 Macroeconomic factors and market efficiency

Macroeconomic variables encompass various indicators reflecting general economic conditions, monetary policy, price levels, and international activity. In this study, we specifically focus on three important macroeconomic variables. Namely interest rates, exchange rates, and oil prices. These variables have been selected due to their relevance in explaining stock price movements (Sensoy and Tabak 2016; Breugem et al. 2020). Interest rates and exchange rates are both financial prices affecting resource allocation, production levels, and stock prices (Coleman Kyereboah and Agyire-Tettey 2008). Oil prices affect the market value of stocks through the expected cash flows and the discount rates. In addition, the impact of oil prices on stock market efficiency can vary depending on whether a country is an oil exporter or importer (Al-hakimi 2022). While changes in macroeconomic variables have been extensively studied in relation to stock returns (Dabbous and Tarhini 2021; Rabushka and Kress 2019; Chen et al. 1986), they have received less attention concerning their effects on stock market efficiency.

Hypothesis (H1a) Stock market efficiency is positively influenced by interest rates.

Yi (2019) emphasizes that a prudent monetary policy supports the stability of financial market. Gopinath et al. (2017) show that a decrease in real interest rates negatively affects capital allocation efficiency in Southern European countries. Conversely, Breugem et al. (2020) find that stock price efficiency increases when long-run interest rates are high, indicating a positive relationship between the long-run interest rates and stock market efficiency. Their analysis demonstrates how monetary policies impact information efficiency in the stock market through their influence on the bond market.

Hypothesis (H1b) Stock market efficiency is positively influenced by the exchange rates.

However, the relationship between exchange rates and stock market efficiency has been relatively underexplored, while previous research mostly focusing either on the cointegration and causality between exchange rates and stock prices (Brahmasrene and Jiranyakul 2007; Sui and Sin 2016; Akel et al. 2015; Tang and Yao 2018; Nguyen 2019), or on the negative association between exchange rates and stock returns (Chen et al. 2022; Morales-Zumaquero and Sosvilla-Rivero 2018; Warshaw 2020). Indeed, If the stock market efficiency incorporates exchange rate information, then only a short-run relationship should exist between changes in the exchange rate and stock returns. If on the other hand, the variables are cointegrated, then the stock market is inefficient. A depreciation in currency leads to increased demand for exports, causing investors to shift funds from domestic assets to foreign currency assets, ultimately impacting stock prices (Kotha and Sahu 2016).

Hypothesis (H1c) Stock market efficiency is negatively influenced by oil price increase.

Oil price is another fundamental macroeconomic variable having a significant impact on stock prices. It must be pointed out that oil market reveals valuable information about the stock’s prices, allowing investors to gather a vital information about the payoffs from its price. Although, the oil price nexus with stock market efficiency has been unexplored, previous research mostly focusing on its relation to stock prices.

Hence, the literature suggests that higher oil prices have a dulling influence on stock market indexes by lowering the expected growth rate of economic activity, increasing input prices, reducing company cash flows, and raising the general price level. Besides, empirical studies show that crude oil prices play a significant role when it comes to economic well-being as well as the health of financial markets (Varghese and Madhavan 2019). Hamilton (1983) shows that crude oil price shock influences the US stock returns. Bani and Ramli, (2019), Echchabi and Azouzi (2017), Jebran et al. (2017), Ekong and Ebong (2016), and Sharma et al. (2018) show a negative relationship between oil prices and stock returns. Al-hakimi (2022) find a long-run relationship between oil prices and Saudi stock market efficiency. However, Coronado et al. (2018) conclude that the direction between stock market index and oil prices are tightly linked and uncertain. Huang et al. (1996) affirm the existence of a significant link between US stock returns and oil future price returns. Using a multivariate VAR model, Park and Rotti (2008) find a positive and significant between oil prices and European stock returns at the short run. Bharn and Nikoloua (2010) use a bivariate EGARCH model to examine the dynamic correlation between Russian stock market returns and oil prices. The results exhibit that global shocks such as the US terrorist attack and the 2003 Iraq war cause a negative correlation between oil prices and stock returns. Basher et al. (2012) show that positive oil price shocks tend to lower emerging markets’ stock prices at the short run. Khalifa et al. (2021) examine the impact of oil returns on the systematic risk of financial institutions in petroleum-based economies and show an increase in risk levels when oil returns are included in the risk function. Mokni et al. (2021) find an asymmetric causality between oil prices and the MSCI stock prices of the G7 countries.

2.2 Microstructure factors and market efficiency

Market microstructure economics examines how stock prices adjust to new information which include market liquidity, market volatility, degree of competition, and market transparency. In this study, we focus on market liquidity and market volatility as the main determinants of market microstructure.

Previous studies show that market liquidity positively affects the efficiency of the stock market by influencing its ability to handle orders (Chordia et al. 2005). A low degree of competition can negatively impact market efficiency by causing prices to deviate from their fundamental values (Blavy 2002). Lagearde et al. (2008) show that market liquidity and market volatility may hinder information flow and market efficiency. Hodera (2015) finds that higher liquidity facilitates arbitrage profits and speeds up price convergence to their fundamental values. This result is consistent with the findings of Chung and Hrazdil (2010) in the US framework.

Hypothesis (H2a) Stock market efficiency is positively influenced by market liquidity.

Regarding market volatility, the excess volatility of stock prices can harm stock market efficiency (Shiller 2015). Return-volatility relationships have been examined in the literature, with longer-term volatility reflecting risk premiums and having a positive relationship with returns. Conversely, the short-term volatility indicates leverage effects and has a negative volatility-return relationship (Harvey 1995; Kim and Singal 1995; Haque and Hassan 2000). Smales (2017) and Schiereck et al. (2016) demonstrate that the implied volatility of financial markets increases with the rise of political uncertainty. Arshad et al. (2020) reveal that the efficiency of the UK stock market worsens during high volatility periods. An increased volatility may adversely affect investor wealth. According to Abid and Hammad (2006), if the increased volatility is not explained by the levels indicated by the fundamental economic factors, there is a tendency for stocks to be mispriced, which negatively affects stock market efficiency.

Hypothesis (H2b) Stock market efficiency is negatively influenced by market volatility.

2.3 Uncertainty factors and market efficiency

Economic policy uncertainty (EPU) index proposed by Baker et al. (2016), the composite leading indicator (CLI) of OECD, and the implied volatility index (VIX) have implications on asset allocation and portfolio risk management. A higher economic uncertainty rises the stock market volatility (Goodell 2020; Pastor and Veronesi 2013), leading to a higher risk premium to bear systematic risk by investors (Hansen 1992). Economic uncertainty (e.g., monetary uncertainty, policy uncertainty, output uncertainty, exchange rate uncertainty, and inflation uncertainty) plays a significant role in understanding stock market efficiency (Gan 2014; Yeap and Gan 2017). The economic uncertainty affects stock markets in different ways, including creating anxiety and distress among global investors, potentially jeopardizing the global investment environment (Chen and Chiang 2020).

Hypothesis (H3a) Stock market efficiency is negatively influenced by EPU.

Hypothesis (H3b) Stock market efficiency is negatively influenced by CLI uncertainty.

2.4 Investor sentiment and market efficiency

Investor psychology and sentiment play a crucial role in the stock market efficiency. Behavioral factors such as overreaction and underreaction to information can lead to a temporary mispricing in stock markets (Shiller 2015; Baker and Wurgler 2007; De Bondt 1985). During periods of positive sentiment, investors may be overconfident noise traders, while during negative sentiment periods, they may rely more on fundamentals to value securities (Shen et al. 2017; Baker et al. 2016; Baker and Wurgler 2007).

Sentiment endurance index (SE) by He (2012) and the consumer confidence index (CCI) are among the most important proxies of investor sentiment that have been used in the literature. The SE index quantifies the impact of optimistic and pessimistic sentiments on stock prices, while the CCI reflects the relationship between consumer confidence and investor sentiment. Investors may become more hesitant and risk-averse during periods of low consumer confidence, leading to a decrease in the efficiency of stock markets. High levels of sentiment endurance may result in market participants relying more on emotions rather than fundamental information, leading to temporary mispricing and reduced market efficiency.

Hypothesis (H4a) Stock market efficiency is negatively influenced by consumer confidence.

Hypothesis (H4b) Stock market efficiency is negatively influenced by the Sentiment Endurance index (SE).

2.5 Global financial and pandemic crises and market efficiency

Previous studies demonstrate that financial crises significantly contribute to stock market inefficiency (Gormsen and Koijen 2020; Zhang et al. 2018). Okorie and Lin (2021) conclude that COVID-19 pandemic crisis plays an important role in the nature of the market's information efficiency. Using a martingale spectral test, the authors show that the Indian stock markets became more information inefficient after the COVID-19 outbreak and in the long term. Conversely, the efficiency of Russian stock market enhances. However, they do not report any change in the levels of information efficiency for both the Brazilian and the US stock markets. Okorie and Lin (2020) show that stock markets are highly interconnected where the spillovers and contagion intensify during the pandemic period. Using the detrended Moving Cross-Correlation technique, they demonstrate that the COVID-19 pandemic has led to significant uncertainty and additional stress on the financial markets, thereby triggering spillovers in global financial markets. Lazar et al. (2012) investigate the impact of the 2008 GFC on the degree of information efficiency in currency markets using the generalized spectral test. The authors find that the global crisis adversely affectes the efficiency of Central and Eastern European currency markets. This result supports the findings of Lim et al. (2008a, 2008b) who show a negative relationship between the Asian economic crisis and the efficiency of Asian stock markets. In contrast, Kim and Shamsuddin (2006) show in significant effect of economic crisis on the degree of efficiency in Hong Kong, Japanese, Korean, and Taiwan stock markets. The uncertainties and market disruptions caused by financial crises can lead to mispricing and reduced information efficiency in the stock markets.

Hypothesis (H5a) Stock market efficiency is negatively influenced by 2008 GFC.

Hypothesis (H5b) Stock market efficiency is negatively influenced by the COVID-19 crisis.

3 Empirical design

The research method proposed in this study can be summarized as follows:

(1) Computation of Time Series Market Efficiency Measure

The first step involves computing the time series market efficiency measure using the non-Bayesian Generalized least squares-based time-varying model (GLS-TV) by Ito et al. (2014, 2016). This model allows for the estimation of time-varying parameters that capture the dynamic efficiency of the stock markets.

(2) Verification of Cross-Section Interdependence and Slope Homogeneity

The next step is to check whether the cross-sections of the data are interdependent, and if the slopes of the variables are homogeneous. This step is important for selecting unbiased panel root tests and cointegration techniques.

(3) Panel Unit Root Tests and Long-Run Elasticity Examination

Panel unit root tests are applied to establish the order of integration for each variable and examine the long-run elasticity among the variables. This step helps in understanding the long-term relationships among variables.

(4) Panel Autoregressive Distributed Lag (ARDL) Model

The data is then analyzed using the Panel Autoregressive Distributed Lag (ARDL) model. This model allows for mixed-order stationarity, making it suitable for examining the long-run and short-run effects of the macroeconomic, microstructure, uncertainty, sentiment, and global shocks variables on stock market efficiency.

(5) Augmented Mean Group (AMG) Estimator

The AMG estimator by Eberhardt and Bondt (2009) and Eberhardt and Teal (2010) is employed as a second-generation estimator that considers mixed-order stationarity, cross-section tendency, and slope heterogeneity with panel data. This estimator produces more reliable results compared to first-generation estimators, especially when the cross-sectional dependence is present.

(6) Non-Causality Test

To examine causal connections among variables, the non-causality test of Dumitrescu and Hurlin (2012) (D–H) is applied. This test accounts for heterogeneous panels and cross-section dependence.

3.1 Measuring the evolving degree of stock markets efficiency:

We employ the Generalized least squares-based time-varying model (GLS-TV) by Ito et al. (2014, 2016) to analyze the evolving degree of G7 stock market efficiency and compute their time-series adjusted market efficiency measures, using a time-varying data generating process framework. Ito et al. (2014) introduce the GLS-based TV-VAR model which is presented in the form of an equation system in which we can represent stock returns at time \(t\) (xt) as an AR(q) process with time-varying coefficients (\(\propto_{{\text{q}}}\)). With \(k\)-dimensional vector represents the rates of returns of the k market indexes.

$${\text{x}}_{{\text{t}}} = \propto_{0} + \propto_{{1,{\text{t}}}} {\text{x}}_{{{\text{t}} - 1}} + \propto_{{2,{\text{t}}}} {\text{x}}_{{{\text{t}} - 2}} + \cdots + \propto_{{{\text{q}},{\text{t}}}} {\text{x}}_{{{\text{t}} - {\text{q}}}} + {\upmu }_{{\text{t }}} \quad t = 1,2 \ldots T$$
(1)

where \({\upmu }_{{\text{t }}}\) is an error term that satisfies \({\text{E}}\left( {{\text{u}}_{{\text{t}}} } \right) = {\text{E}}\left( {{\text{u}}_{{\text{t}}}^{2} } \right) = {\text{E}}\left( {{\text{u}}_{{\text{t}}} {\text{u}}_{{{\text{t}} - {\text{m}}}} } \right) = 0{\text{ for all m}}\).

While Hansen (1992) rejects the constancy of the VAR coefficient matrix and explains that the VAR is unsuitable for the time series with structural breaks as the stock returns. Then, Ito et al. (2014) use a time-varying vector autoregressive (TV-VAR) model that allows parameters of the VAR matrix to be time varying according to the following equation:

$$\propto_{l,t} = \propto_{l,t - 1} + v_{l,t} \quad \left( {{\text{l}} = {1},{2}, \ldots {\text{q}}} \right)$$
(2)

where \(v_{l,t}\) satisfies \({\text{E}}\left( {{\text{v}}_{{{\text{l}},{\text{t}}}} } \right) = {\text{E}}\left( {{\text{v}}_{{{\text{l}},{\text{t}}}}^{2} } \right) = {\text{E}}\left( {{\text{v}}_{{{\text{l}},{\text{t}}}} {\text{v}}_{{{\text{l}},{\text{t}} - {\text{m}}}} } \right) = 0\quad {\text{for}}\;{\text{all}}\;{\text{m}}\).

We then solve the system of the following simultaneous equations using Eqs. (1) and (2):

$$\left\{ {\begin{array}{*{20}l} {x_{t} = \propto_{0,t} + \propto_{1,t} x_{t - 1} + \propto_{2,t} x_{t - 2} + \cdots + \propto_{q,t} x_{t - q} } \hfill \\ { \propto_{1} = \propto_{1,t} + v_{1,t} } \hfill \\ \end{array} } \right.$$
(3)

Using the GLS-based TV-VAR model of Ito et al (2014, 2016), we first compute the time-varying degree of market efficiency (MEt) as the deviation from the zero coefficient on the corresponding TV-MA model to the TV-AR model (Noda 2020). We define the time-varying degree of market efficiency based on Ito et al. (2014, 2016) as:

$$ME_{t} = \left| {\frac{{\mathop \sum \nolimits_{j = 1}^{p} \widehat{{a_{j,t} }}}}{{1 - \left( {\mathop \sum \nolimits_{j = 1}^{p} \widehat{{a_{j,t} }}} \right)}}} \right|$$
(4)

\(ME_{t}\) measures how close to or far from the efficient market the actual market is. This implies that large deviations from zero of (\(ME_{t}\)) are evidence of market inefficiency. Therefore, \(ME_{t}\) is known to be subject to sampling errors hence, we employ the bootstrap procedure to construct the confidence interval for \(ME_{t}\) under the null hypothesis of market efficiency (zero autocorrelation). However, if the estimates of \(ME_{t}\) exceed the 95% confidence intervals, that implies a rejection of the null hypothesis of no return autocorrelation at a 5% significance level. This adjustment allows considering the stock market at the time \(t\) as inefficient when \(ME_{t}\) exceeds the upper limit at the t period of the intervals. therefore, we can compute the time-varying adjusted market efficiency (TV-AdjME) measure at time t as follows:

$${\text{TV Adj}} - {\text{ME}}_{{\text{t}}} = {\text{ ME}}_{{\text{t}}} {-}{\text{ The}}\;{\text{upper}}\;{\text{limit}}_{{\text{t}}} \;{\text{of}}\;{\text{the}}\;{95}\% \;{\text{confidence}}\;{\text{intervals}}$$
(5)

Then, if the estimates of the TV-AdjMEt > 0, we reject the null hypothesis of market efficiency at time t. If not, we accept the efficiency of the stock market at this time.

Noda (2020) points out four advantages of using the GLS-TV to measure the time-varying degree of market efficiency: (1) it does not depend on sample size, (2) it does not require iterations by Markov chain Monte Carlo algorithm or Kalman filtering smoothing, (3) the method applies to a wide range of time-varying models, and (4) it does not require prior distribution of parameters as the GLS-TV approach can estimate the time-varying parameters even with non-Gaussian errors in the model. Then, according to (GLS-TV) model, we can employ the residual-based bootstrap method and the time-varying estimates to conduct statistical interference (Noda 2019).

Appendix” displays the driving forces of market efficiency which are categorized into five groups: (1) macroeconomic (2) microstructure, (3) uncertainty, (4) sentiment, and (5) global shock factors.

3.2 Cross-sectional dependency and slope homogeneity test

Ertur and Musolesi (2017) show that ignoring cross-sectional dependence in panel data will have severe implications, specifically it makes traditional panel estimation methods inaccurate. We use Pesaran (2004) cross-sectional dependence (CD) test. the CD equation is given as:

$$CD = \sqrt {\frac{2T}{{N(N - 1)}} } \left( {\mathop \sum \limits_{i = 1}^{N - 1} \mathop \sum \limits_{j = i + 1}^{N} \varphi_{ij} } \right)$$
(6)

Another issue of importance in panel data is the slope heterogeneity which indicates that significant economic occurrences found in one country are not necessarily replicated in the other countries. In this study, we test for the slope homogeneity by using Pesaran et al. (2008) methodology. The standard dispersion statistic is captured as:

$$\tilde{\Delta } = \sqrt N \left( {\frac{{N^{ - 1} S - k}}{2k}} \right)$$
(7)

Alternatively, the bias adjusted version of the standard dispersion statistics may be computed as follows:

$$\tilde{\Delta }_{Adj} = \sqrt N \left( {\frac{{N^{ - 1} S.E(\widetilde{{z_{it} )}}}}{{\sqrt {Var(} \widetilde{{z_{it} )}}}}} \right)$$
(8)

Both \(\tilde{\Delta }\) and \(\tilde{\Delta }_{Adj}\) are tested under the null hypothesis of slope homogeneity.

3.3 Panel unit root tests and cointegrations tests

The normal unit root tests in models presume cross-sectional independence and therefore can yield misleading consequences. In this paper, we use a second-generation unit root test, which checks the problem of cross-sectional dependency across socio-economic structures in the model. The CADF and CIPS panel unit root test proposed by Pesaran (2007) are used to establish the order of integration of each variable. These tests overcome the cross-section independence by introducing heterogeneous impact into multiple unobservable factor models, making the test results more consistent. As with Pesaran (2007), the CIPS unit root test is specified as follows:

$$CIPS = N^{ - 1} \mathop \sum \limits_{i = 1}^{N} CADF_{i}$$
(9)

where \(CADF_{i}\) is the cross-sectional augmented dickey Fuller test; N is the number of observations. We run each test with variables in both levels and first differences.

After demining the panel unit root, we use the panel cointegration tests of panel data developed by Westerlund (2008) to examine the long-run elasticity among variables being studied in our paper. The choice of Westerlund cointegration test is motivated by its relevance by considering the dependence of panel cross-section unlike the conventional cointegration test proposed by Pedroni (19992004) and Kao (1999). This method fully considers the dependence of panel cross-section. The cointegration test of the error correction base is presented as follows:

$$\Delta y_{t} = \gamma_{i} d_{t} + \rho_{i} \left( {y_{i,t - 1} - \beta_{i} x_{i,t - 1} } \right) + \mathop \prod \limits_{j = 1}^{\mu i} \delta_{ij} \Delta y_{i,t - j} + \mathop \prod \limits_{j = 0}^{\mu i} \delta_{ij} \Delta yx_{i,t - j} + \varepsilon_{it}$$
(10)

where N (i = 1,…,N) denotes the number of cross-sections, and T(t = 1,…,T) denotes the number of observations.

3.4 Heterogeneous panel causality test

Although the Granger causality test is one of the most popular cointegration technique, it has shown some drawbacks. Up till now, Dumitrescu and Hurlin’s (2012) approach has been an efficient method to determine the direction of the causal linkages among variables. It is particularly useful for estimating a model with a cross-section dependence and a slope heterogeneity. The D-H technique can be written as follows:

$$y_{it} = \alpha_{i} + \mathop \sum \limits_{k = 1}^{K} \gamma_{i}^{k} y_{i,t - k} + \mathop \sum \limits_{k = 1}^{K} \beta_{i}^{k} x_{i,t - k} + \varepsilon_{it}$$
(11)

where \(\gamma_{i}^{k}\) and \(\beta_{i}^{k}\) are the coefficient of estimator, which fluctuate across countries. \(x\) and \(y\) measure the causality. The statistics of the D-H causality test are computed as follows:

$$W_{N,t}^{HNC} = \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} W_{i,t}$$
(12)
$$Z_{N,T}^{HNC} = \sqrt{\frac{N}{2K}} \left( {W_{N,T}^{HNC} - k} \right)\sim N(0,1)$$
(13)

where \(W_{i,t}\) is the Wald statistic and \(W_{N,T}^{HNC}\) statistic is obtained with averaging each Wald statistics for cross-sections. In this context, the null hypothesis states that there is no Granger causality between variables, whereas the alternative hypothesis states that one or more variables have a Granger causal link.

3.5 Panel autoregressive distributed lag (ARDL) model and AMG estimator

Following Pesaran et al. (2001), the panel ARDL approach is a powerful technique to deal with relationships between I(1) and I(0) variables. Equation (14) indicates the general form of the ARDL model.

$$\Delta Y_{it} = \beta_{0} + \beta_{1} Y_{it - 1} + \beta_{2} X_{it - 1} + \mathop \sum \limits_{k = 1}^{n1} \theta_{1} \Delta Y_{it - k} + \mathop \sum \limits_{k = 0}^{n2} \theta_{1} \Delta X_{it - k} +\epsilon_{it}$$
(14)

where \(Y_{it}\) denotes the dependent variable,.\(X_{it - 1}\). is the independent variable, and \(\Delta\) denotes de difference operator. \(\mathop \sum \limits_{k = 0}^{n2} \theta_{1} \Delta X_{it - k}\) represents the short-run dynamics and \(\beta_{2} X_{it - 1}\) representes the long-run equilibrium relationship.

To account for cross sectional dependence as well as differences in the impact of observables and unobservable across panel groups, we use the Augmented Mean Group (AMG) estimator introduced by Eberhardt and Bondt (2009) and Eberhardt and Teal (2010).

The estimation using the AMG estimator takes place in two steps. In the first step, a pooled regression model is used using the first difference OLS:

$$\Delta_{{y_{it} }} = \alpha_{i} + \beta_{i} \Delta x_{it} + \mathop \sum \limits_{t = 2}^{T} c_{t} \Delta D_{t} + \varepsilon_{it}$$
(15)

The second step of AMG is specified as follows:

$$\hat{\beta }_{AMG} = N^{ - 1} \mathop \sum \limits_{i} \hat{\beta }_{i}$$
(16)

where \(\Delta\) is the first difference operator, D is the time variable, and \(c_{t}\) is a coefficient.

4 Data and basic statistics

This study uses monthly closing prices data of G7 stock markets, including the S&P/TSX for Canada, DJIA for the US, FTSE 100 for the UK, CAC 40 for France, FTSE-Italia all shares for Italy, DAX 30 for Germany, and NIKKEI 225 for Japan. Further, we consider the consumer confidence index, Economic Policy Index, Composite Leading Indicator, interest rates, exchange rates, and crude oil prices. The sample period spans from June 1, 2005, to June 1, 2022, covering major events such as the Global Financial Crisis (GFC), the European debt crisis, the oil price crash in mid-2014, and the COVID-19 crisis. The stock returns are defined as the first differences in natural log levels between two consecutive prices. Table 1 provides a summary of the data description and sources.

Table 1 Data description

The correlation matrix in Table 2 shows the relationships between the adjusted market efficiency measure (ADJME) and various other variables. Notably, market efficiency is positively related to macroeconomic factors (INTER) and financial indicators (CLI) but negatively and significantly related to the EPU index, COVID-19 pandemic crisis (COVID19), market volatility (VOLAT), and market liquidity (LIX).

Table 2 The correlation matrix

Table 3 presents the summary statistics of the adjusted market efficiency measure yield by the TV-AR approach of Ito et al. (2014) for the G7 stock markets. Individual degree of efficiency for each country shows time-varying patterns with positive maximum and negative minimum for all G 7 markets, except for the UK. The average market efficiency is negative for all markets, except for the US. All market efficiency series are positively skewed and leptokurtic. Table 4 presents the summary statistics of macroeconomic variables. For the interest rates, the mean is positive for all G7 countries. The standard deviation is highest for the UK. As for the exchange rate, the standard deviations indicate a high volatility from the mean values for all the G7 countries. For oil price, the maximum price is 132 US dollars per barrel and the minimum is 18.38 US dollars. All variables exhibit positive skewness. The kurtosis values are higher than the specified threshold, underlying a deviation from the normal distribution.

Table 3 Summary statistics of market efficiency
Table 4 Summary statistics of macroeconomic factors

Tables 5, 6 and 7 present the summary statistics of the uncertainty, microstructure, and sentiment variables. The results show that most variables exhibit non-normal distribution characteristics, with high skewness and kurtosis values. This implies that the time series data for these variables do not follow a normal distribution pattern.

Table 5 Summary statistics of uncertainty indexes
Table 6 Summary statistics of microstructure factors
Table 7 Summary statistics of sentiment indexes

5 Results

Previous studies employ a time-varying autoregressive (TV-AR) model to compute the time-varying degree of G7 stock market efficiency and conduct statistical inference. The first step is to measure the stock market's deviation from the efficient condition, given by Eq. (4). We use the BIC and AIC criteria to select the optimal lag order of the AR (q) estimation (see Table 17).

Table 8 provides descriptive statistics of the monthly returns, showing the range of returns from Italy's − 0.15% to the US's 0.57%. The UK stock market exhibits the lowest volatility among the G7 markets (3.89%), while Italy experiences the highest volatility (6.01%).

Table 8 Descriptive statistics and unit root tests of stock market returns

Before carrying the estimations of the TV-VAR model, it is important to ensure that all variables under investigation are stationary. For this purpose, we employ the ADF-GLS (Augmented Dickey–Fuller with Generalized Least Squares) test introduced by Elliott et al. (1996). According to Ito et al. (2014), the ADF-GLS test is more powerful compared to other existing unit root tests. Table 8 shows that the ADF-GLS test rejects the null hypothesis of the unit root test at the 1% significance level for all variables.

Next, the stability of the estimated parameters is checked using Hansen's (1992) test under the random parameter's hypothesis. Panel A in Table 9 shows that the AR(1) estimates are statistically significant at the conventional levels for all stock markets. The Lc (Lagrange multiplier) results strongly reject the null hypothesis of parameter stability at the 1% significance level for all the G7 countries except for both the UK and Japan. However, the results for the multivariate AR process for the G7 countries in Panel B of Table 9 show that the null hypothesis of parameter stability is rejected at the 1% significance level, suggesting the time-varying parameters hypothesis.

Table 9 AR (1) estimates and Hansen’s parameter constancy test

Second, we check the stability of the estimated parameters using the Hansen’s (1992) test under the random parameter hypothesis. Panel A in Table 9 shows that the AR(1) estimates are statistically significant at the conventional levels for all stock markets. The Lc results strongly reject the null hypothesis of parameters stability at the 1% significance level for all the G7 countries except for the UK and Japan. Results for the multivariate AR process for the G7 countries are reported in Panel B of Table 9. The results show that the null hypothesis of parameter stability is rejected at the1% significance level, supporting the hypothesis of the time-varying parameters.

To overcome the problem of sampling errors, we use the bootstrap method to compute the confidence bands for the market efficiency (MEt) under the null hypothesis of stock market efficiency. The Adjusted Market efficiency is then computed according to Eq. (5).

Figure 1 displays the evolving market efficiency of the G7 countries. The graphical evidence shows that market efficiency is time-varying and sensitive to market conditions, which supports the Adaptive Market Hypothesis (AMH). The results reveal a higher inefficiency during the 2008 GFC for Italy, France, US, and Japan. This is not surprising as chaotic financial environments during crisis periods can lead to higher inefficiencies in the markets. The US market is shown to be the worst hit by the crisis in terms of market efficiency. However, all the G7 stock markets remain globally efficient and display smaller deviations from efficiency for the whole sample period.

Fig. 1
figure 1

Time-varying market efficiency in the G7 countries. We run the bootstrap sampling 2.000 times to calculate the confidence intervals. R version 3.6.1 was used to compute the statistics. Market efficiency is computed using Eq. (5)

After determining the stock market efficiency measure, we test for cross-section dependence of all G7 stock markets. The results reported in Table 10 show that the null hypothesis of cross-sectional independence is strongly rejected at the 1% significance level for all market, implying a shock transmission from one market to the others. Moreover, we test the hypothesis of slope homogeneity using the test proposed by Pesaran et al. (2008). The results presented in Table 11 indicate that the null hypothesis of homogeneity can be rejected for all markets. This reveals that the slope coefficients are not homogeneous across the G7 markets.

Table 10 Cross-section dependence (CSD) test
Table 11 Pesaran et al. (2008) slope homogeneity tests

Given the results of the cross-section dependency and slope dependency tests, it is appropriate to employ heterogenous panel techniques that take into account the cross-sectional dependency.

Secondly, we apply second-generation panel unit root tests, namely the cross-section augmented Dicky Fuller (CADF) and the cross-section Im–Pesaran (CIPS) unit root tests. The results summarized in Table 12 exhibit that the variables are either I(0) (stationary) or I(1) (integrated of order 1) at different levels of significance, and they become stationary at first difference. None of the variables are integrated of an order greater than one. This implies that the Panel ARDL model can be used to examine the long-run and short-run effects of macroeconomic, microstructure, uncertainty, sentiment, and global shocks variables on G7 stock market efficiency. The use of the Panel ARDL model accounts for cross-sectional dependency, slope heterogeneity, and mixed-order stationarity with panel data, providing a robust framework for analyzing the relationships among variables.

Table 12 Panel Unit root test results

Since the conventional cointegration tests (for example the Pedroni test and Kao test) fail to capture the cross-section dependence, we use the Westerlund (2007) cointegration test, which is suitable where a correlation between cross-section units exist, to examine the long-run relationships among market efficiency of G7 economies. Table 13 shows that the null hypothesis of no cointegration relationship is strongly rejected by three out of four statistics, indicating that some panels are cointegrated.

Table 13 Results of the Westerlund panel cointegration test

The econometric method used in the study allowed for examining the relationship between stock market efficiency and each of the selected variables at the country level. The AMG estimator allows one to obtain unique slope coefficients for each of the G7 countries. Tables 14 and 15 present the long-run estimates using the AMG estimator to capture the elasticity of the coefficients and assess the impact of macroeconomic, microstructure, uncertainty, sentiment, and global shocks factors on G7 stock market efficiency.

Table 14 Outcomes of the AMG estimator
Table 15 Country specific coefficients with AMG estimator

The results demonstrate that exchange rates and interest rates have insignificant effects on market efficiency. However, there is a negative and significant relationship between oil prices and stock market efficiency, suggesting that changes in oil prices represent a relevant driving force of stock market efficiency of the G7 countries. Contrary to the expectations, microstructure factors such as market volatility and market liquidity have an insignificant impact on stock market efficiency. The economic policy uncertainty (EPU) is significantly and positively related to the adjusted market efficiency measure. Regarding global shock factors, the results varyacross countries. For both Canada and Germany, the GFC has a negative and significant coefficient with the adjusted market efficiency, while for the remaining countries (USA, UK, France, Italy, and Japan), it had a positive and significant coefficient. These differences indicate variations in price informativeness during the GFC across the G7 countries.

However, the COVID-19 pandemic is negatively and significantly related to the adjusted market efficiency variable for all countries except Canada. This suggests that the stock market efficiency of the G7 countries decreased considerably during the COVID-19 pandemic.

In summary, the study provides valuable insights into the determinants of stock market efficiency in the G7 countries and highlights the importance of considering macroeconomic, microstructure, uncertainty, and global shock factors to better understand the dynamics of market efficiency under different economic conditions and major events.

For a deepen analysis, we examine the causal relationship among market efficiency and its leading factors using the heterogeneous panel causality method. The results are presented in Table 16. According to the estimates of the D–H Granger non-causality test, all macroeconomic, microstructure, uncertainty, and global shock factors, except for the GFC, are Granger cause the market efficiency of the G7 stock markets. This result suggests that past values of these factors contribute to predict future values of market efficiency. Furthermore, there is evidence of bidirectional causality between market efficiency and both changes in the exchange rates, changes in interest rates, Europe Brent crude oil prices, VIX, EPU, and CLI. Figure 2 displays the D–H Granger non-causality results. As we can see, there is evidence of both unidirectional and bidirectional causality between market efficiency and each of the considered factors. However, the Consumer Confidence Index (CCI) was found not to Granger cause market efficiency.

Table 16 Results of D–H Granger non-causality test
Fig. 2
figure 2

D–H Granger non-causality results

These findings indicate that there are complex and dynamic interactions between market efficiency and various factors, with some factors influencing market efficiency in a unidirectional way, while others show a bidirectional causal relationship. The bidirectional causality between market efficiency and certain factors suggests evidence of feedback mechanisms and interactions among these variables, where changes in one variable can affect market efficiency and vice versa. Overall, the heterogeneous panel causality analysis provides valuable insights into the causal relationships between market efficiency and its leading factors in the G7 countries, shedding light on the dynamics of these relationships and their implications for understanding the determinants of market efficiency.

6 Conclusions

This paper examines the key factors that influence stock market efficiency in the G7 countries, spanning various macroeconomic, microstructure, uncertainty, sentiment, and global shock factors. We use the TV-AR approach to accurately measure changing degrees of market efficiency over time. Several econometric techniques, including the second generation of unit root tests, slope homogeneity test, CSD test, cointegration test, and the newly developed AMG estimator, were applied to produce reliable findings and uncover the relationship between stock market efficiency and its leading factors.

The results show significant relationships between stock market efficiency and crude oil prices as well as the COVID-19 outbreak. Moreover, we find that higher oil prices stimulate stock market inefficiency, indicating the importance of understanding the nexus between the energy market and stock market efficiency. These findings hold crucial implications for both investors and policymakers. For investors, the information revealed by various factors may help in building beliefs regarding stock market efficiency and identifying profitable arbitrage opportunities. Policymakersshould prioritize credible actions to reduce the uncertainty, build resilience against external shocks, and restore investor sentiment. Additionally, strategic adjustments to energy policies should be considered in light of the observed impact on stock market efficiency. The fidings pave the way for further research and policy actions to enhance market efficiency and promote the stability of financial markets.

Our paper has some limitations, such as excluding important variables like geopolitical risk, spillover effects among markets, and technological advancements in new information and communication technologies (NICT). Future research should explore these other hypotheses to gain a comprehensive understanding of the driving forces affecting stock market efficiency. Furthermore, our analysis is limited to G7 countries, and extending the scope to include other countries (emerging and developing) would provide a fuller picture of how various factors influence stock market efficiency. Additionally, while the GLS-TV model is used as a stock market efficiency measure, more flexible models like Bayesian structural breaks models, time-varying parameter VAR models with stochastic volatility, and Unobserved components with stochastic volatility models should be considered in future research for a more comprehensive analysis.