Skip to main content

Investor sentiment and sustainable investment: evidence from North African stock markets

Abstract

This paper examines the connectedness between investor sentiment and returns and volatility on environmental, social, and governance (ESG) indices in Morocco and Egypt. Therefore, we construct a new investor sentiment index and use weekly data from January 2018 to December 2023, along with the time, frequency and quantile connectedness methods. The results show that investor sentiment sometimes influences the returns and volatility of the ESG indices, and sometimes it is influenced by them. This connectedness is stronger during distress events, namely, the COVID-19 outbreak and geopolitical tensions (the Russian-Ukrainian and Israeli-Palestinian conflicts). Furthermore, the spillover effect between sentiment and returns on the ESG indices is mainly due to short-term spillovers, except during the COVID-19 period, when long-term spillovers dominate. However, the spillover effect between sentiment and volatility on the ESG indices is mainly due to long-term spillover, especially during the COVID-19 outbreak and the Russia-Ukraine War, implying the persistence of shock transmission due to high uncertainty. The findings also highlight the impact of market conditions on spillovers. These findings can help socially responsible investors successfully diversify their portfolios and adjust their strategy according to investor sentiment; they also have beneficial implications for policymakers in achieving sustainable development goals.

Introduction

Sustainability has become a central concern in recent years. The Brundland Report for the World Commission on Environment and Development [11] defines this concept as ‘The development that meets the needs of the present without compromising the ability of future generations to meet their own needs’. In September 2015, the UN General Assembly adopted the 2030 Agenda for Sustainable Development with a set of Sustainable Development Goals. These goals are to be met in each country for the period 2016–2030. In this regard, stock markets can play an important role in promoting sustainability and contributing to the achievement of sustainable development goals. This includes the implementation of sustainability indices, which include only companies that meet specific environmental, social and governance (ESG) requirements.

ESG assesses a company’s sustainability from a nonfinancial perspective, which involves the efficient management of environmental resources, the promotion of positive social relations and the maintenance of high standards of ethical conduct [7]. It refers to the capacity of a company to perform in a way that preserves ecological integrity, social well-being, and principles of good governance, while simultaneously creating value for its shareholders [44].

Increasing concerns about sustainability are driving investors to focus on ESG performance. Therefore, ESG-related stocks have received much attention from investors and are being included in their portfolios [25]. This increasing attention can have a positive effect on ESG index returns in financial markets [19, 45].

From a company’s perspective, ESG performance can reinforce the brand reputation and loyalty of responsible companies [51], which helps attract loyal managers, investors, and customers [31]. Loyal investors are incentivized by nonpecuniary rewards to invest in ESG assets and are hence unlikely to sell their investments, even during crises [29]. Furthermore, companies that report ESG information gain financial support [45, 58]. In fact, rating agencies have embraced the principle of responsible investment, which integrates ESG issues into their rating methods, which implies that firms with better ESG scores receive better ratings [4] and thus lower interest rates. Consequently, ESG performance might improve companies’ resilience to risk and help them receive financial support, particularly in times of crisis, as a reward for environmental sustainability [26]. Several studies analyzed the impact of ESG scores on company performance [12, 17, 30, 45, 49, 50, 61].

From the perspective of behavioral finance, stock markets are not completely efficient, and investor sentiment might significantly influence asset prices [8, 23, 32, 63]. However, few studies examined the relationship between sentiment and sustainability indices using different proxies for investor sentiment. For instance, using consumer sentiment, Giannarakis et al. [27] and Pitoska et al. [57] showed that sentiment has a positive impact on sustainability indices. Using social network sentiment, López-Cabarcos et al. [43] found that sentiment has a greater impact on the S&P 500 Environmental and Socially Responsible Index than on the S&P 500 Index. El Ouadghiri et al. [19] employed the Google Search Volume Index as a proxy for investor attention and found that investors’ attention to climate change and pollution has a significant positive impact on sustainability index returns. Based on 10 sentiment proxies, Dhasmana et al. [16] reported an asymmetric relationship between the ESG index and investor sentiment.

Nevertheless, studies dealing with spillovers between sentiment and sustainability indices are in short supply in the literature. Several studies analyzed spillovers between sentiment and other sustainable assets such as green bonds [53, 55], but studies on spillovers between sentiment and ESG indices are limited. Examining the connectedness between sentiment and sustainability indices provides us with an in-depth understanding of how sentiment and ESG indices interact, which can provide valuable information to policymakers and pro-ESG investors. Moreover, no study has examined this connectedness in North African markets. As this region is more sensitive to climate change, some countries, namely, Morocco and Egypt, have recently launched the ESG index on their stock exchanges. Therefore, the spillover effect between investor sentiment and sustainability indices should be carefully examined in these countries. It is noteworthy that although the study is limited to the North African region, it is of wider international interest, as it could encourage socially responsible investors from all over the world to invest in this region. This study also highlights the progress made by emerging countries in terms of sustainability, which is an international issue.

An interesting observation from the related literature is that different measures of sentiment have been used, which could yield mixed results. Accordingly, developing an aggregate sentiment index that encompasses important measures could be of great interest in this direction.

The goal of this paper is to examine the dynamic connectedness between our newly constructed ‘sustainable investment sentiment index’ and the returns and volatility of the ESG indices in North Africa. We include only Morocco and Egypt in this study because they are the only countries that have launched the ESG index on their stock markets in North Africa. Moreover, these countries could be representative of North Africa, as they have the largest stock markets in the region.

We make five contributions to the literature. First, our study is the first to examine the bidirectional effect between sentiment and returns and volatility on ESG indices, which provides a comprehensive study of this relationship. Second, we study this relationship in North Africa, where it has never been investigated before. Examining this region is particularly relevant because it is more sensitive to climate change, and growing interest among investors in sustainable investment has led some stock markets to introduce ESG indices recently. Third, we propose a new ESG-related sentiment index that overcomes the limitations of other sentiment proxies that take a single measure separately, which results in mixed findings. Therefore, we combine different measures into an aggregate index based on both qualitative and quantitative methods, which can lead to a highly accurate measure of sentiment. Fourth, our sample covers recent major events, namely, the COVID-19 outbreak and certain geopolitical tensions (the Russian-Ukrainian and Israeli-Palestinian conflicts), which offers useful insight into how these distress events influence the connectedness between sentiment and sustainability indices. Finally, by combining the latest proposed connectedness methods, we investigate the spillover effect over time, at different frequencies and under different market conditions by focusing on extreme events, such as the COVID-19 pandemic, the Russia-Ukraine war, and the Israeli-Palestinian conflict. This approach would provide more valuable information to investors, as it detects the market conditions under which investor sentiment can strongly predict the movements of ESG indices.

The rest of the paper is structured as follows. Section "Literature review" provides a brief review of relevant related studies. Section "Methodology and data" presents the methodology and data. Section "Results and discussion" outlines and discusses the empirical results of the study. Section "Conclusions" concludes.

Literature review

According to the efficiency market hypothesis [22], investors can process information rationally, which results in market efficiency in which prices reflect all available information. Nevertheless, this approach fails to explain market anomalies. In this sense, behavioral finance proves that investor sentiment might influence stock prices and explain many market anomalies [3, 39]. Therefore, including investor sentiment in investment decisions could improve portfolio profit [24]. Investor sentiment can be defined as an investor’s optimism or pessimism about stock market expectations [3]. Several measures of investor sentiment have been proposed, including market proxies, newspaper sentiment, social media sentiment, the consumer confidence index, and the Google Search Volume Index. Specifically, using Twitter as a measure of mood, Bollen et al. [8] reported that investor mood can improve the accuracy of the DJIA index prediction. Clear evidence of the predictive capacity of Twitter sentiment on the S&P 500 Index was reached by Zhang et al. [65]. By analyzing the linkage between social network sentiment and the S&P 500 Index, Piñeiro-Chousa et al. [54] highlighted the effect of experienced users’ sentiment on S&P 500 returns. The inverse relationship between sentiment and stock market activity was also investigated. For instance, Kim and Kim [34] found that stock prices influence the sentiment contained in investors’ posts on Yahoo! Finance. Similarly, Piñeiro-Chousa et al. [56] note that Tobin’s Q, capitalization and the P/E ratio can affect investor sentiment obtained from posts on StockTwits. Thus, there is two-way feedback between stock markets and social network-based sentiment.

Da et al. [14] proposed the Google Search Volume Index (GSVI), which has become a popular tool for capturing investor attention. Several behavioral finance studies show that investor attention has an impact on asset pricing. In fact, stocks in the news or with high transaction volume attract more attention from investors, who thus become netbuyers of these stocks, causing a temporary increase in prices and a decrease in subsequent returns [5]. With respect to this, Joseph et al. [33] argue that investor attention might predict excess returns and trading volume. To capture investor attention, various studies have widely used the GSVI to examine the linkage between investor attention and stock markets [13, 59, 60]. These studies found evidence for the impact of investor attention on asset performance in the markets examined.

Due to climate change, social concerns and governance issues, investors are becoming increasingly aware of ESG investing and are focusing more on sustainable investment. Accordingly, many stock markets around the world have introduced ESG indices that include companies that meet environmental, social, and governance criteria. Although ESG indices are derived from general indices, they are more sensitive to market fluctuations than are general indices [50]. This can be attributed to investor sentiment and, more specifically, to investors’ sensitivity to sustainable investment. Some studies have examined the relationship between investor sentiment and ESG indices or sustainable companies. For example, López-Cabarcos et al. [43] showed that social network sentiment has a large effect on the volatility of the S&P 500 Environmental and Socially Responsible Index compared to its impact on the S&P 500 Index. Gutsche et al. [28] found that investors also value extra financial factors, such as feelings of warm glow or social norms, when making decisions on socially responsible investments. La Torre et al. [36] reported that ESG strategies positively affect the returns of a few firms, mostly belonging to specific sectors, such as energy and utilities. Dhasmana et al. [16] established an interconnection between the ESG index and investor sentiment. Using newspaper-based ESG sentiment, Liu et al. [41] found that ESG sentiment is positively associated with the volatility risk premium, especially the impact of environmental and social factors. Using the same approach, Yu et al. [64] showed that higher news-based ESG sentiment can lower stock price crash risk by reducing negative ESG incidents, information asymmetry, and agency costs.

Despite a few studies that analyzed the relationship between sentiment and ESG indices, no study has explored the spillover between sentiment and ESG index returns and volatility in a single study, especially in North Africa. Moreover, the studies reviewed earlier used various sentiment proxies separately, which might produce inconclusive results. While certain investors use internet searches, others are more present in social networks, and still others are targeted by direct surveys. Combining these different measures into an aggregate index can provide a highly accurate measure of investor sentiment. These issues are addressed in this study.

Methodology and data

Methodology

We combine the latest methods to study the connectedness between investor sentiment and ESG indices over time, at different frequencies and under different market conditions.

Time-spillover approach of Diebold and Yilmaz [18] (DY [18])

To examine the spillover between sentiment and ESG indices in the time domain, we use the generalized forecast error variance decomposition (GFEVD) approach of Diebold and Yilmaz [18]. The GFEVD at forecast horizon H (\({\theta }_{{jk}}\left({H}\right))\), which can be interpreted as the effect a shock in variable k has on variable \(j\) in terms of its forecast error variance share, can be written in the following form:

$$\theta _{{jk}} \left( H \right) = \frac{{\sigma _{{kk}}^{{ - 1}} \sum\nolimits_{{h = 0}}^{H} ( \Psi _{h} \sum {)_{{jk}} } )^{2} }}{{\sum\nolimits_{{h = 0}}^{H} ( \Psi _{h} \sum {\Psi _{h} ^{\prime } } )_{{kk}} }}$$
(1)

in which \({\sigma }_{{kk}}\) is the diagonal element matrix \(\sum , {\Psi }_{{h}}\) is a coefficient matrix \(({N}\times {N})\) with lag h.

\({\theta }_{{jk}}\left({H}\right)\) can be standardized as follows:

$${\tilde{\theta }}_{{{{jk}}}} \left( {{H}} \right) = \frac{{{\theta }_{{{{jk}}}} \left( {{H}} \right)}}{{\mathop \sum \nolimits_{{{{k}} = 1}}^{{{N}}} {\theta }_{{{{jk}}}} \left( {{H}} \right)}},\;{\text{with}}\;\mathop \sum \limits_{{{{k}} = 1}}^{{{N}}} {\tilde{\theta }}_{{{{jk}}}} \left( {{H}} \right) = 1\;{\text{and}}\;\mathop \sum \limits_{{{{j}},{{k}} = 1}}^{{{N}}} {\tilde{\theta }}_{{{{jk}}}} \left( {{H}} \right) = N$$
(2)

in which \({\widetilde{\theta }}_{{jk}}\left({H}\right)\) denotes the directional spillover from variable \(k\) to variable \(j\) at \(H\).

The overall spillover can be represented as:

$${{C}}_{{H}}=100\times \frac{\sum_{{j},{k}=1,{j}\ne {k}}^{{N}}{\widetilde{\theta }}_{{jk}}\left({H}\right)}{\sum_{{j},{k}=1}^{{N}}{\widetilde{\theta }}_{{jk}}\left({H}\right)}$$
(3)

The TO spillover calculates the directional spillover from variable \(j\) to all other variables in the system. It has the following form:

$${({C}}_{{H}}{)}_{\leftarrow {j}}=100\times \frac{\sum_{{k}=1,{j}\ne {k}}^{{N}}{\widetilde{\theta }}_{{kj}}\left({H}\right)}{\sum_{{j},{k}=1}^{{N}}{\widetilde{\theta }}_{{kj}}\left({H}\right)}$$
(4)

The FROM spillover measures the directional spillover from all other variables in the system to variable \(j\). It is defined as follows:

$$({{C}}_{{{H}}} )_{{{{j}} \leftarrow }} = 100 \times \frac{{\mathop \sum \nolimits_{{{{k}} = 1,{{k}} \ne {{j}}}}^{{{N}}} {\tilde{\theta }}_{{{{jk}}}} \left( {{H}} \right)}}{{\mathop \sum \nolimits_{{{{j}},{{k}} = 1}}^{{{N}}} {\tilde{\theta }}_{{{{jk}}}} \left( {{H}} \right)}}$$
(5)

The net directional spillover of variable \(j\) is represented as:

$$({{C}}_{{{H}}} )_{{{j}}} = ({{C}}_{{{H}}} )_{{ \leftarrow {{j}}}} - ({{C}}_{{{H}}} )_{{{{j}} \leftarrow }}$$
(6)

The net pairwise spillover between variables \(k\) and \(j\) is measured using:

$$({{C}}_{{{H}}} )_{{{{jk}}}} = 100 \times \frac{{{\tilde{\theta }}_{{{{kj}}}} \left( {{H}} \right) - {\tilde{\theta }}_{{{{jk}}}} \left( {{H}} \right)}}{{{N}}}$$
(7)

Frequency-spillover approach of Baruník and Křehlík [6] (BK [6])

The frequency connectedness [6], which is an advancement of the Diebold and Yilmaz's [18] approach, decomposes spillovers into high-frequency and low-frequency spillovers. The first spillover states that the connectedness is the result of shocks that have a short-lived effect on the system, while the second spillover indicates that the connectedness is the result of shocks that cause structural changes within the system and leave a longer-term mark on the variables. Thus, we include the frequency spillover model in our study.

According to Baruník and Křehlík [6], \(\Psi \left( {e^{{ - i\omega }} } \right) = \sum _{h} e^{{ - i\omega h}} \Psi _{h}\) represents the frequency response function obtained from the Fourier transform of the coefficient \({\Psi }_{h}\) with \(i=\sqrt{-1}.\) The generalized causation spectrum over frequencies \(\omega \in (-\pi ,\pi )\) is defined as:

$${\theta }_{{jk}}\left(\omega \right)=\frac{{\sigma }_{{kk}}^{-1}|\Psi ({{e}}^{-{i\omega }})\sum {)}_{{jk}}{|}^{2}}{(\Psi ({{e}}^{-{i\omega }}){\sum\Psi }^{{^{\prime}}}({{e}}^{+{i\omega }}){)}_{{jj}}}$$
(8)

where \(\Psi \left({{e}}^{-{i\omega }}\right)={\sum }_{h}{{e}}^{-{i\omega h}}{\Psi }_{h}\) represents the Fourier transform of the impulse response \({\Psi }_{h}\), and \({\theta }_{{jk}}\left(\omega \right)\) indicates the proportion of the \(j{\text{th}}\) variable at a given frequency ω due to shocks in the \(k{\text{th}}\) variable.

The generalized variance decomposition at a certain frequency band \(d = (a, b)\) is described as:

$${\theta }_{{jk}}\left({d}\right)=\frac{1}{2\pi }{\int }_{{a}}^{{b}}{{\Gamma }_{j}\left(\omega \right)\theta }_{{jk}}\left(\omega \right){{\text{d}}\omega }$$
(9)

in which \({\Gamma }_{j}\left(\omega \right)\) represents the power of the \(j{\text{th}}\) variable at a given frequency and is defined as:

$${\Gamma }_{j}\left(\omega \right)=\frac{(\Psi ({{e}}^{-{i\omega }}){\sum\Psi }^{{^{\prime}}}({{e}}^{+{i\omega }}){)}_{{jj}}}{\frac{1}{2\pi }{\int }_{-\pi }^{\pi }(\Psi ({{e}}^{-{i\lambda }}){\sum\Psi }^{{^{\prime}}}({{e}}^{+{i\lambda }}){)}_{{jj}}{{\text{d}}\lambda }}$$
(10)

The normalized generalized variance decomposition at the frequency band \(d\) can be obtained as follows:

$${\widetilde{\theta }}_{{jk}}\left({d}\right)=\frac{{\theta }_{{jk}}\left({d}\right)}{\sum_{{k}}{\theta }_{{jk}}\left(\infty \right)}$$
(11)

in which \({\theta }_{{jk}}\left(\infty \right)\) is the contribution over all frequencies.

All GFEVD-based connectedness measures can be calculated in the same way as in (3)–(7).

Quantile connectedness approach of Ando et al. [2]

The approaches discussed earlier consider the mean-based VAR, which does not allow us to assess whether the comovement between the variables in the system depends on the strength (extreme quantile) and the nature of the shock (high or low quantile). To this end, we include in our study the connectedness approach of Ando et al. [2], which is a modified version of the mean-based measures that considers both extreme positive structural shocks (i.e., upper quantiles) and extreme negative structural shocks (i.e., lower quantiles). To calculate the connectedness metrics at each quantile τ, we first estimate a quantile vector autoregression, \({\text{QVAR}}(p)\), which is defined as follows:

$${{y}}_{{t}}=\mu \left(\tau \right)+\sum_{{k}}^{{p}}{\Phi }_{{k}}(\tau ){{y}}_{{t}-{k}}+{{u}}_{{t}}\left(\tau \right)$$
(12)

in which \({{y}}_{{t}}\) and \({{y}}_{{t}-{k}}\), \(k=1,\dots ,p\) are \({N}\times 1\)-dimensional endogenous variable vectors, \(\tau\) stands for the quantile of interest and is in \([{0,1}]\), \(p\) represents the lag length of the \({\text{QVAR}}\) model, \(\mu \left(\tau \right)\) denotes the \({N}\times 1\)-dimensional conditional mean vector, \(\sum_{{k}}^{{p}}{\Phi }_{{k}}(\tau)\) is an \({N}\times {N}\)-dimensional \({\text{QVAR}}\) coefficient matrix, and \({{u}}_{{t}}\left(\tau \right)\) represents the \({N}\times 1\)-dimensional error vector, which has an \({N}\times {N}\)-dimensional error variance–covariance matrix \(\sum \left(\tau \right).\) To transform the \({\text{QVAR}}(p)\) to its quantile vector moving average representation, QVMA(), we use Wold’s theorem: \({{y}}_{{t}}=\mu \left(\tau \right)+\sum_{{k}}^{{p}}{\Phi }_{{k}}(\tau ){{y}}_{{t}-{k}}+{{u}}_{{t}}\left(\tau \right)=\mu \left(\tau \right)+\sum_{{j}=0}^{\infty }{\Psi }_{{j}}(\tau ){{u}}_{{t}-{j}}\). Then, following Koop et al. [35] and Pesaran and Shin [52], the GFEVD at forecast horizon \(H\), which illustrates the impact a shock in variable \(k\) has on variable \(j\), is calculated as follows:

$${\theta }_{{jk}}^{{g}}\left({H}\right)=\frac{\sum (\tau {)}_{{kk}}^{-1}\sum_{{h}=0}^{{H}-1}(({{{e}}_{{j}}^{{^{\prime}}}\Psi }_{{h}}(\tau )\sum (\tau ){{e}}_{{k}}{)}^{2}}{\sum_{{h}=0}^{{H}-1}{({{e}}_{{j}}^{{^{\prime}}}\Psi }_{{h}}\left(\tau \right)\sum \left(\tau \right){\Psi }_{{h}}(\tau {)}^{{^{\prime}}}{{e}}_{{j}})}$$
(13)

in which \({{e}}_{{j}}\) stands for a zero vector with unity on the \(j\)th position. In the decomposition matrix, the normalization of elements is as follows:

$${\widetilde{\theta }}_{{jk}}^{{g}}\left({H}\right)=\frac{{\theta }_{{jk}}^{{g}}\left({H}\right)}{\sum_{{k}=1}^{{k}}{\theta }_{{jk}}^{{g}}\left({H}\right)}$$
(14)

The normalization results in the following equalities:

$$\mathop \sum \limits_{{{{k}} = 1}}^{{{N}}} {\tilde{\theta }}_{{{{jk}}}}^{{{g}}} \left( {{H}} \right) = 1\;{\text{and}}\;\mathop \sum \limits_{{{{j}},{{k}} = 1}}^{{{N}}} {\tilde{\theta }}_{{{{jk}}}}^{{{g}}} \left( {{H}} \right) = {{N}}$$
(15)

Next, following Diebold and Yilmaz [18], all GFEVD-based connectedness measures can be calculated as follows. The total connectedness index (TCI), which measures the average level of total spillover, is given by:

$${{\text{TCI}}}={{N}}^{-1}\sum_{{j},{k}=1,{j}\ne {k}}^{{N}}{\widetilde{\theta }}_{{jk}}^{{g}}\left({H}\right)$$
(16)

This measure can be viewed as a proxy for market uncertainty.

The total directional connectedness \({\text{TO}}\) others is given by:

$${\text{TO}}_{{j}}=\sum_{{k}=1,{j}\ne {k}}^{{N}}{\widetilde{\theta }}_{{kj}}^{{g}}\left({H}\right)$$
(17)

The total directional connectedness \({\text{FROM}}\) others is expressed as follows:

$${\text{FROM}}_{{j}}=\sum_{{k}=1,{j}\ne {k}}^{{N}}{\widetilde{\theta }}_{{jk}}^{{g}}\left({H}\right)$$
(18)

The \({\text{NET}}\) total directional spillover is as follows:

$${\text{NET}}_{{j}}\left({H}\right)={\text{TO}}_{{j}}-{\text{FROM}}_{{j}}$$
(19)

If \({\text{NET}}j> 0\), variable \(j\) impacts all other variables more than being impacted by them. In this case, it is considered a net transmitter of shocks; otherwise, it is a net receiver.

The net pairwise connectedness (\({\text{NPDC}}\)) is calculated by:

$${\text{NPDC}}_{{jk}}\left({H}\right)={\widetilde{\theta }}_{{jk}}^{{g}}\left({H}\right)-{\widetilde{\theta }}_{{kj}}^{{g}}\left({H}\right)$$
(20)

If \({\text{NPDC}}_{jk}(H) > 0\), this implies that the variable \(k\) influences the variable \(j\) more than the variable \(j\) influences the variable \(k\), and thereby the variable \(k\) dominates the variable \(j\), and vice versa.

Data

To test the spillover between investor sentiment and sustainable investment returns in Morocco and Egypt, we use weekly data from the Casablanca ESG and S&P/EGX ESG indices. The Casablanca ESG and S&P/EGX ESG were launched in 2018 and 2010, respectively. Their purpose is to raise awareness of companies that perform well on the three parameters of environmental, social, and corporate governance responsibility relative to their market peers. The data obtained from the Moroccan and Egyptian stock market websites cover the period from January 2018 to December 2023. The period under investigation is informative in terms of extreme events, as it covers the COVID-19 crisis and the years that followed, as well as geopolitical tensions (the ongoing wars between Russia and Ukraine and between Israel and Palestine). We include general market indices to control for general market conditions. For this purpose, we use the MASI index (for Morocco) and the EGX30 index (for Egypt). Based on the weekly closing prices, we calculate the first log difference of the time series to obtain the returns as follows:

$${{R}}_{{it}}={\ln}{({p}}_{{it}}/{{p}}_{{it}-1})$$
(21)

in which \({{p}}_{{it}}\) is the weekly closing price of the index \(i\) at time \(t\), and \({{p}}_{{it}-1}\) is the weekly closing price of the index \(i\) at time \(t-1\). We use weekly data to avoid the nonsynchronous trading effect associated with daily data.

With respect to volatility, we use the conditional variance from the univariate GARCH model [9], which we apply to each return series to estimate the volatility series of the variables. In addition to the variables of interest, we include market volatility to control for general market conditions. Formally, the standard \({\text{GARCH} }({p},{q})\)Footnote 1 model can be expressed as follows:

$${{y}}_{{t}}={{x}}_{{t}}\beta +{\varepsilon }_{{t}}, {\varepsilon }_{{t}}={{h}}_{{t}}{{e}}_{{t}}, {{h}}_{{t}}^{2}=\phi +\sum_{{i}=1}^{{p}}{\lambda }_{{i}}{\varepsilon }_{{t}-{i}}^{2}+\sum_{{j}=1}^{{q}}{\gamma }_{{j}}{{h}}_{{t}-{j}}^{2}$$
(22)

in which \(p\) denotes the order of the moving average ARCH term, \(q\) stands for the order of the autoregressive \({\text{GARCH}}\) term, \({{y}}_{{t}}\) expresses the conditional mean,\({{h}}_{{t}}^{2}\) is the conditional variance, \({\varepsilon }_{{t}}^{2}\) is the squared residual, \({\lambda }_{{i}}\) are the ARCH parameters, \({\gamma }_{{j}}\) are the GARCH parameters, \({{e}}_{{t}}\) is a white noise process, and \(\phi\) is a constant.

Regarding investor sentiment, we construct a new ‘sustainable investment sentiment index’. Indeed, investors are becoming interested in sustainability criteria when making investment decisions. Sustainability refers to a company’s ability to comply with ESG criteria, which includes the efficient management of environmental resources, the promotion of positive social relations and the maintenance of high standards of ethical conduct [7]. Online ESG search, sustainability-related posts on social media, and public opinion on sustainability could reflect investor sentiment toward ESG investing. Therefore, to accurately measure investment sentiment toward sustainable investment, we develop an aggregate index that combines three sentiment proxies widely used in the literature, namely, \(\mathbb{X}\) sentiment (Twitter), the Google Search Volume Index (GSVI), and the consumer confidence index (CCI).

For \(\mathbb{X}\) (Twitter) sentiment, we collected daily posts related to sustainable investment using related keywords, such as “sustainable investment Morocco” (“sustainable investment Egypt”), “environmental, social, and governance criteria Morocco” (“environmental, social, and governance criteria Egypt”), and “ESG Morocco” (“ESG Egypt”), from \(\mathbb{X}\) (Twitter) platform for the period 2018–2023. After cleaning the raw posts, we assigned each post a sentiment score using natural language processing.Footnote 2Then, the weekly average sentiment was computed to form a time series of the weekly sentiment index using the following formula:

$${\text{TSent}}_{{t}}=\sum_{{i}=1}^{{n}}\frac{{\text{Sent}}_{{it}}}{{{N}}_{{t}}}$$
(23)

in which \({\text{TSent}}_{{t}}\) stands for the weekly sentiment at time \(t\), \({\text{Sent}}_{{it}}\) is the sentiment score of message \(i\) posted at time \(t\), and \({{N}}_{{t}}\) is the number of messages posted at time \(t\). This index ranges from \(-1\) to 1, in which \(-1\) is interpreted as extremely pessimistic and \(1\) as extremely optimistic, while a neutral tweet equals zero. As far as the GSVI is concerned, we use the GSVI of the topic ‘Environmental, social, and governance criteria’Footnote 3 in Morocco and Egypt, obtained via Google Trends. The final component of our sentiment indicator is \({\text{CCI}}\).Footnote 4 The \({\text{CCI}}\) provides insights into individuals’ sentiments regarding their personal financial ability and purchasing behavior and regarding the economy as a whole. A value above 100 indicates an optimistic consumer attitude, while a value below 100 reflects a pessimistic attitude. The inclusion of the CCI in our index is justified for two reasons. First, the CCI controls for the effect of general economic conditions on investor sentiment. Second, the CCI survey includes many questions related to sustainability. All the values are normalized to the range \([-{1,1}].\) Next, based on Li et al. [38], we construct our sentiment index as follows:

$${\text{Sent}}_{{i}}={\omega }_{1}{\text{TSent}}+{\omega }_{1}{\text{GSVI}}+{\omega }_{3}{\text{CCI}}$$
(24)

where \(\omega _{{1,2,3}} = \frac{{{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\sigma ^{2} }}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${\sigma ^{2} }$}}}}{{\sum\nolimits_{{i = 1}}^{3} {{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\sigma ^{2} }}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${\sigma ^{2} }$}}} }}\), in which \({\sigma }^{2}\) represents the variance respective of \({\text{TSent}}\), or \(\text{GSVI}\) or \({\text{CCI}}\).

Table 1 shows the descriptive statistics of the sentiment, return, and volatility series. Overall, the sentiment index in Morocco has a greater mean and lower dispersion than in Egypt. This indicates that Moroccans are more optimistic about sustainable investment than Egyptians are. Returns in Egypt have a lower mean than returns in Morocco, but they are more volatile in Egypt than in Morocco. We also observe that returns are negatively skewed because of negative changes in returns. Kurtosis is greater for all the return variables than in the normal distribution, which by construction equals 3. Thus, the distributions are leptokurtic, which is considered a stylized fact in financial markets. The volatility series are positively skewed and have a high kurtosis coefficient, implying a non-Gaussian distribution. The sentiment indices are also non-Gaussian, as evidenced by the skewness coefficient being positive, meaning that the distribution is skewed to the right due to positive changes in sentiment. Kurtosis values different from 3 confirm this nonnormality. The Jarque–Bera test of normality also corroborates the nonnormality of all variables. All these characteristics justify our methodology presented earlier.

Table 1 Descriptive statistics of the series

To check the stationarity of the variables, we use the ADF test. All series show stationarity because the ADF unit root test is highly significant. The significant ARCH-LM test implies the presence of the ARCH effect (heteroscedasticity) in the return series, which justifies the use of the GARCH model to calculate volatility.

Results and discussion

Spillover between investor sentiment and returns on ESG indices

From a static perspective, Table 2 presents the average connectedness results using the DY [18] and BK [6] frameworks. While DY [18] represents spillovers in the time domain, BK [6] decomposes these spillovers in terms of the frequency domain, i.e., short-term and long-term. The total connectedness index is 33.14% in Morocco and 30.85% in Egypt, suggesting that the Moroccan market is riskier than the Egyptian market. In the short term, the overall connectedness in Morocco is 31.81%, while it is 35.51% in Egypt, which indicates that the Egyptian financial market becomes riskier than the Moroccan market in the short term. However, in the long term, the Moroccan market is riskier than the Egyptian market. Considering the directional connectedness between sentiment and ESG returns, we observe that at the aggregate level, in both Morocco and Egypt, sentiment influences ESG returns less (0.45% in Morocco and 0.41% in Egypt) than it is influenced (0.82% in Morocco and 2% in Egypt), suggesting that sentiment is a net receiver of shocks from ESG returns. The impact of sentiment on ESG returns is driven by short-term rather than long-term shocks in both markets. Nonetheless, the impact of ESG returns on sentiment is greater in the long term (0.55%) than in the short term (0.26) in Morocco but greater in the short term (1.27%) than in the long term in Egypt (0.72%). These results show that the behavior of Moroccan investors differs from that of Egyptian investors, particularly in terms of the time horizon. This might offer opportunities for arbitrage and diversifications.

Table 2 Averaged spillover results in the time and frequency domains

Net spillovers are negative for sentiment in both markets, indicating that sentiment is a net receiver of return shocks within the system. However, it appears that ESG returns are net receivers of shocks in Morocco but net transmitters of shocks in Egypt. Considering frequency spillovers, ESG returns are net receivers in the short term but net transmitters in the long term in Morocco, while the opposite is the case in Egypt. This implies that investing in ESG is less risky in the long term in Morocco than in Egypt, as net shock transmitters would be affected by a smaller number of risk sources. This provides an opportunity for a diversification strategy in both markets.

Although full-sample spillovers offer a useful summary of average spillovers, they do not detect important cyclical patterns in spillovers emanating from economic and financial turbulence or from evolving investor behavior. The evolutionary approach to markets implies that the impact of investor behavior on stock markets varies over time [20, 21, 37, 42]. To capture this, we re-estimate the spillovers using a 52-week rolling window. Figure 1a, b displays the total spillover in the time domain in Morocco (a) and Egypt (b). It shows that the total connectedness index (TCI) is time-varying and event dependent. Specifically, a significant spike is observed at the onset of the COVID-19 outbreak in both markets, implying that the market risk was extremely high during the crisis (approximately 40% in Morocco and 60% in Egypt). A significant decline occurred in 2021, which coincided with the recovery period from the outbreak and the end of COVID-19-related measures in several countries. In early 2022 and late 2023, there was also an increase in the TCI, which corresponds to the Russia-Ukraine war and the Israeli-Palestinian conflict, respectively. This finding confirms Mensi et al. [46] that intense economic times generate feelings of fear and uncertainty, leading to significant spillovers. Additionally, we observe that the TCI is higher in Egypt most of the time than in Morocco, which indicates that the Egyptian market is riskier than the Moroccan market.

Fig. 1
figure 1

Time-varying total spillovers in the time and frequency domains between sentiment and returns. Note: The blue and green areas represent the short and long term, respectively. The results are based on a \({\text{VAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

To thoroughly understand the sources of spillovers in the system, we examine the frequency dynamics of the connectedness, as market participants have heterogeneous anticipations and thus heterogeneous frequency responses to shocks. Figure 1c, d shows that the dynamic spillovers are determined by heterogeneous frequencies, which correspond to the heterogeneous beliefs and preferences among investors. However, we find that the spillovers are primarily driven by the short-term component, up to 3 weeks, apart from the period corresponding to the COVID-19 pandemic. This is because during periods when markets are prone to process information quickly, connectedness is created at high frequency, and thus, a shock in one variable in the system primarily affects short-term cyclical behavior. Nevertheless, when connectedness comes from a lower frequency, this indicates that shocks are being transmitted for longer periods. One explanation is that during periods of high uncertainty, shocks are being transmitted slowly and affect markets for longer, but after a period of high uncertainty, markets tend to stabilize and prosper, uncertainty and fear diminish, so shocks are transmitted more quickly through the system, and their influence diminishes after a few times, creating short-term spillovers. This is consistent with the conclusion of Baruník and Křehlík [6]. Another observation from Fig. 1c, d is that while long-term spillovers dominate short-term spillovers for a short period in Egypt, this characteristic holds over a long period in Morocco. This implies that the COVID-19 crisis made Moroccan investors passive for a longer period than Egyptian investors. In contrast, the Russia-Ukraine war and Israeli-Palestinian conflict coincide with an increase in mainly short-term spillovers, indicating that shocks during these geopolitical tensions are short-lived.

Since we focus on the relationship between sentiment and the returns on the ESG indices, we calculated the time and frequency of pairwise spillovers between these two variables. Figure 2a, b depicts the variation over time in total spillovers between sentiment and the ESG index returns in Morocco (Fig. 2a) and Egypt (Fig. 2b). The findings reveal that sentiment switches from the net transmitter to the net recipient. Indeed, net transmission tends to be followed by net reception, implying a time-varying bidirectional relationship between sentiment and the returns of ESG indices. Specifically, we note that during 2019, sentiment influenced the returns of the ESG indices more than it was influenced by them, especially in the Egyptian market. This indicates a strong investors concern with sustainable investment, which is characterized by a high transmission of shocks to ESG indices. In contrast, in early 2022, sentiment becomes a net recipient of shocks from ESG indices, as COVID-19 increases the sensitivity of investors to shocks in sustainable investment, which might have a considerable impact on the returns of ESG indices in subsequent periods. Nonetheless, while sentiment is a net transmitter in 2021 and the first quarter of 2022 in Morocco, it is a net receiver in Egypt. Looking at the frequency domain depicted in Fig. 2c, d, we notice that, overall, the pairwise spillovers are mainly driven by the short-term component in Egypt and the long-term component in Morocco, except at the beginning of the COVID-19 crisis, when long-term spillovers dominate in both markets. Therefore, during the COVID-19 pandemic, long-term shocks that create uncertainty led to connectedness. This can be plausibly explained by the fact that strong uncertainty about the economic situation accompanied by lower stock market returns translates into more persistent responses of investors to shocks.

Fig. 2
figure 2

Time-varying net pairwise spillovers in the time and frequency domains between sentiment and the returns of ESG indices. Note: The blue and green areas represent the short and long term, respectively. The results are based on a \({\text{VAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

Now, it is clear that the connectedness between investor sentiment and the returns of the ESG indices is time-varying and event dependent. To further our analysis and explore the direction and magnitude of the dynamic connectedness between sentiment and the ESG indices under different market conditions, we used the quantile connectedness approach of Ando et al. [2]. First, we estimate the average spillovers at the median and extreme quantiles (Table 3) before estimating the time-varying spillovers at different quantiles. We note that the TCI is greater under extreme market conditions (5th and 95th quantiles) in both markets than under normal conditions (at the median), which indicates that the markets are riskier under extreme conditions because of the impact of uncertainty, optimism, and pessimism that prevail in extreme market conditions, so that shocks in sentiment are transmitted to the system, creating strong connectedness.

Table 3 Return and volatility spillover results at the median, 5th quantile and 95th quantile

The net directional spillovers between sentiment and ESG returns indicate that the impact of sentiment on ESG returns is lower under stable conditions (at the median) (3.61% in Morocco and 16.17% in Egypt) than under bearish market conditions (at the 5th quantile) (20.49% in Morocco and 19.23% in Egypt) or under bullish market conditions (at the 95th quantile) (20.29% in Morocco and 38.48% in Egypt). The same pattern can be observed when considering the influence of ESG returns on sentiment.

To capture the impacts of both market conditions and economic and geopolitical events, we re-estimate the results in a dynamic setting. Figure 3a, b plots the total quantile connectedness in Morocco (a) and Egypt (b). Warmer shades on the graph reflect greater levels of connectedness. Stronger connectedness in the system is observed during the lower and upper extreme quantiles, but as investor sentiment and market returns move toward the middle quantiles, the connectedness decreases significantly. Furthermore, we observe that during the COVID-19 period, the connectedness is more pronounced in the lower quantiles than in the other quantiles, which highlights that the crisis negatively impacts returns and amplifies risk in the market. Our findings are consistent with those of Deng et al. [15], who revealed that the spillover between investor attention and environmentally friendly stocks is asymmetric. This can be attributed to investors’ responses to bad news emanating from the ESG market. However, this result is not in line with that of Nyakurukwa and Seetharam [48], who reported that there is no statistically significant investor response to negative ESG-related news.

Fig. 3
figure 3

Quantile total connectedness between sentiment and returns. Notes: Warmer shades indicate strong connectedness. The results are based on a \({\text{QVAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

For the pairwise spillover between sentiment and the returns on the ESG indices, the estimation results are shown in Fig. 4a, b. Warmer shades on the graphs indicate net transmission. The results for Morocco (Fig. 4a) are different from those for Egypt (Fig. 4b). In fact, sentiment in Morocco is steadily receiving shocks from the ESG indices, except for some periods when it is a net emitter. The receipt of shocks is greater in the lower and upper quantiles than in the middle quantiles. Notable episodes of net receiving correspond to the COVID-19 event (March 2020) in the lower quantile (negative returns) and the end of many COVID-19-related measures (mid-2021) in the upper extreme quantile (positive returns). For some periods, sentiment acted as a net transmitter, including in early 2019, one year after the launch of the ESG Index, just prior to the COVID-19 pandemic when the market was stable, and at the start of the Russia-Ukraine War and its consequences in terms of fossil energy inflation. With respect to Egypt, we note that sentiment assumes the roles of both transmitter and receiver over time. Additionally, a notable episode of net receiving occurred during the COVID-19 crisis in the lower quantile. The transmitter role is assumed primarily in early and late 2019 in the upper quantiles, in early 2021 in the lower quantiles, and in late 2022 in all quantiles. Thus, in general, while sentiment is a net receiver primarily in the upper or lower extreme quantiles, it acts as a net transmitter under normal market conditions. This implies that Moroccan and Egyptian investors become more sensitive to sustainable investment during distress events, which might lead them to pay more attention to what is being said about sustainable investment. This conclusion contradicts that of Dhasmana et al. [16], who found that investor sentiment does not influence the ESG index in India, indicating that Indian investors are indifferent to the ESG initiatives adopted by companies.

Fig. 4
figure 4

Quantile net pairwise connectedness (Sentiment-ESG return). Notes: Warmer shades indicate net transmission. The results are based on a \({\text{QVAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

Spillover between investor sentiment and the volatility of ESG indices

Regarding volatility connectedness, we examine market risk at the aggregate level, at different frequencies, and quantiles from both static and dynamic perspectives. Table 2 shows the estimation results for the static connectedness between sentiment, ESG volatility and stock market volatility at the aggregate (panel A), short-term (panel B) and long-term (panel C) levels. The total spillover index calculated using the DY [18] methodology is 34.37% in Morocco and 32.03% in Egypt, confirming that the risk in Morocco is greater than that in Egypt. The total spillover emanates mainly from the long-term spillovers for both markets. In the short-term, the Egyptian market is riskier than the Moroccan market; however, in the long-term, the Moroccan market becomes riskier than the Egyptian market.

In terms of the pairwise connectedness between sentiment and ESG volatility, we notice that at the aggregate level, sentiment explains 0.75% of the forecast error variance of ESG volatility in Morocco; however, the forecast error variance of sentiment explained by ESG volatility is 2.03%. In Egypt, the risk is greater, as sentiment has an impact of 3.31% on ESG volatility, and ESG volatility contributes to sentiment by 1.64%. The significant spillover between sentiment and ESG volatility implies that investor sentiment amplifies risk in these markets. This connectedness is more pronounced in the long term than in the short term.

Nevertheless, the static measure of spillovers assumes that the model coefficients remain unchanged over the entire sample, which fails to capture structural breaks that occur due to extreme events. To overcome this drawback, we re-estimate the spillovers over time. Figure 5 presents the time-varying estimates of the total connectedness index in the time (Fig. 5a, b) and frequency domains (Fig. 5c, d). Figure 5a shows the results for Morocco that suggest that the connectedness among sentiment and volatility varies over time, ranging from 31 to 65%, which denotes a greater sentiment-volatility connectedness compared to sentiment-returns connectedness. Compared to that in the Egyptian market (Fig. 5b), we note that in general, the spillover effect in Egypt is greater than that in Morocco, implying that the former is riskier than the latter. The overall spillover peaks during March 2020, around February 2022, and at the end of 2023 when shocks created a large portion of uncertainty and thus large spillover in the system, which corresponds to the COVID-19 pandemic, the Russia-Ukraine war, and the Israeli-Palestinian conflict, respectively. In these contexts, the shocks in the system created further uncertainty, which was then transmitted across the system. The troughs in spillover during the quiet periods, late 2021 in Morocco and mid-2021 in Egypt, are due to less uncertainty transmission and hence low connectedness, which corresponds to economic recovery from the COVID-19 crisis. This result is in line with that of Liu et al. [40], who demonstrated that exposure to COVID-19 increased market volatility. However, this finding disagrees with those of Albuquerque et al. [1] and Broadstock et al. [10], who suggest that companies with higher ESG scores have less stock price volatility during crisis periods, such as the COVID-19 pandemic.

Fig. 5
figure 5

Time-varying total spillovers in the time and frequency domains between sentiment and volatility. Note: The blue and green areas represent the short and long term, respectively. The results are based on a \({\text{VAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

The total spillover provides aggregate information about how risk varies over time. It does not provide any information on whether shocks that create strong connectedness influence the system in the short or long run. To examine this point, we calculated the spillover effect at different frequencies. In Fig. 5c,d, we note that the total spillover is mainly driven by the long-term spillover. Overall, long-term spillover dominates short-term spillover in both markets. As a result, the shock transmission between sentiment and the volatility of the ESG indices occurs over a longer period, especially in Morocco, where short-term connectedness is low (from 1 to 10%). The most striking observation is that during events with high uncertainty, such as the COVID-19 epidemic and the Russia-Ukraine War, long-term spillover dramatically dominates short-term spillover. This is because investors react very slowly to the arrival of news due to high uncertainty during this period, which results in the shock being transmitted for a longer period and thereby in long-term spillover. This result is in line with Baruník and Křehlík [6].

Examining Fig. 6 related to the net pairwise spillover between sentiment and the ESG indices, we observe a feedback channel between the variables, in which periods when sentiment is a net receiver tend to be followed by periods when it is a net transmitter, with the magnitude of the spillover reaching a high point during specific periods. This finding implies that shocks in ESG index returns lead investors to pay more attention to what is being said about sustainable investment in social media and Internet. This can create shocks in sentiment and therefore attract more investors to invest in sustainable investment, resulting in large movements in the returns on the ESG indices, which is consistent with the finding by Liu et al. [41] that ESG sentiment is positively related to the volatility risk premium. Notable episodes include the COVID-19 crisis, when investor sentiment appears to be a large net transmitter of shocks to the ESG indices, implying that sentiment about sustainable investment makes the returns of the ESG indices more volatile, and in turn, this volatility influences sentiment in subsequent periods. This finding agrees with that of Wan et al. [62], who reported that the degree of focus on ESG has dramatically increased since 2020, which implies that ESG attention has been considerably affected by the epidemic. In addition, we find a high shock transmission from sentiment to volatility on the ESG indices during the first part of 2022, which corresponds to the Russia-Ukraine war and its consequences in terms of inflation. The same pattern can be observed in late 2023, which corresponds to the start of the Israeli-Palestinian conflict. The results imply that during an extreme event, the connectedness between sentiment and the volatility of the ESG indices is strong, and sentiment becomes a net transmitter, which is different from the results obtained when considering ESG index returns, in which sentiment is a net receiver during an extreme event. Indeed, during a crisis period, market returns decrease significantly, creating high uncertainty that transmits shocks to market volatility. As with the total connectedness index, the pairwise spillover is also driven by long-term shocks most of the time (Fig. 6c, d).

Fig. 6
figure 6

Time-varying net pairwise spillovers in the time and frequency domains between sentiment and the volatility of the ESG indices. Note: The blue and green areas represent the short and long term, respectively. The results are based on a \({\text{VAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

To explore how market conditions influence the interdependence between sentiment and volatility on ESG indices, we examine the spillover effect at different quantiles in static and dynamic frameworks. The results for average spillovers at different quantiles are summarized in Table 3. We find that the TCI is greater under extreme market conditions than under normal conditions, while it is greater at the upper tail (95th quantile) than at the lower tail (5th quantile). We also observe that there is a strong feedback channel between sentiment and ESG volatility at the 95th quantile in both markets, ranging from 31.22 to 31.50%. This implies that high ESG volatility creates uncertainty, which can translate into significant fluctuations in market returns.

For the dynamic framework, Fig. 7 shows that the total connectedness index is stronger in the upper quantiles than in the other quantiles for both markets. The notable periods correspond to the COVID-19 period in the first part of 2020, the disruptions generated by the Russia-Ukraine war in 2022, and the conflict between Israel and Palestine at the end of 2023. Therefore, periods of crisis lead to high volatility and, ultimately, strong connectedness between sentiment and volatility.

Fig. 7
figure 7

Quantile total connectedness between sentiment and volatility. Notes: Warmer shades indicate strong connectedness. The results are based on a \({\text{QVAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

Now, we examine the relationship between sentiment and volatility on the ESG indices in different market states. The estimation results, displayed in Fig. 8, show that investor sentiment transmits shocks to the volatility of the ESG indices mainly in the upper quantiles. As with previous results, notable episodes include the COVID-19 epidemic, the Russia-Ukraine war, and the Israeli-Palestinian conflict characterized by uncertainty and hence high volatility. Our results are consistent with those of Naeem et al. [47], who found that investor sentiment acts as a leader of stock market volatility. This implies that sentiment can be used to predict ESG volatility in the Moroccan and Egyptian markets in the upper quantiles and that investors can obtain abnormal returns by using sentiment information to predict markets with high volatility. Therefore, investors should adjust their ESG-based portfolios in a timely manner based on investor sentiment.

Fig. 8
figure 8

Quantile net pairwise connectedness (sentiment-ESG volatility). Notes: Warmer shades indicate net transmission. The results are based on a \({\text{QVAR}}\) model with a 52-week rolling window size and a 100-step-ahead forecast horizon

Conclusions

This paper investigated the dynamic connectedness between our newly constructed sentiment index and the returns and volatility of the ESG indices in Morocco and Egypt. To this end, we used weekly returns and GARCH-based volatility on the ESG indices from January 2018 to December 2023, as well as the time, frequency and quantile connectedness approaches. The empirical results revealed that the spillover between sentiment and ESG indices varies over time and across countries depending on turbulent events. Furthermore, the results show that sentiment shifts from the net transmitter to the net receiver over time, indicating the feedback channel between investor sentiment and ESG indices, especially during extreme events. Interestingly, the spillover between sentiment and the returns on the ESG indices is mainly driven by the short-term component, except for the COVID-19 epidemic. This can be explained by the fact that during a crisis, shocks translate slowly into ESG returns and have an effect over longer periods due to uncertainty . Moreover, during the COVID-19 epidemic, the spillover effect is stronger in the lower quantile, demonstrating that the crisis generates negative returns, which strongly affects investor sentiment. With respect to volatility, the findings show that, overall, long-term spillover dominates short-term spillover, especially in Morocco. In addition, the connectedness is greater in the upper quantile, indicating that during periods of uncertainty (COVID-19 and geopolitical tensions), market volatility increases, which leads to strong connectedness. Such uncertainty leads sentiment to act as a net transmitter of shocks to volatility in ESG indices.

This study has valuable implications for both investors and policymakers. Indeed, the results provide useful information for socially responsible investors on spillovers between sentiment and the returns and volatility of ESG indices to successfully manage their portfolios. In particular, they allow them to detect under which market conditions sentiment can strongly predict the movements of ESG indices. Furthermore, the results show the possibility for investors to diversify their portfolios geographically (Morocco vs. Egypt) and to adjust their ESG strategy in a timely manner. As far as policymakers are concerned, the findings enable them to achieve the UN goals by attracting more attention to sustainable investment through communication on social networks, for example. The study also has wider international implications, as it highlights the progress made by emerging economies in terms of sustainability, as well as the attention given to sustainability by investors in different regions of the world.

We studied the spillover effect between sentiment and ESG indices in each market separately, but it would be interesting to examine this spillover across different developed and emerging countries. It would also be interesting to analyze the differences between the results of ESG and non-ESG indices. We will consider these issues in future research.

Availability of data and materials

The datasets used and analyzed during the current study are available from the corresponding author on reasonable request.

Notes

  1. We find that \(\text{GARCH} ({1,1})\) for Casablanca ESG, MASI, Casablanca ESG volatility, MASI volatility, EGX30, and EGX30 volatility, as well as \(\text{GARCH} ({1,2})\) for SP/EGX ESG are the best fit among the other GARCH-order or GARCH-type specifications. Optimal orders were determined based on the Akaike Information Criterion (AIC).

  2. Python was used to collect and calculate the sentiment score.

  3. As a robustness check, we used other keywords related to sustainable investment. Nevertheless, the findings on these keywords were not significant.

  4. Data were collected from https://tradingeconomics.com. The quarterly data were converted to weekly data by linear interpolation.

Abbreviations

ESG:

Environmental, social, and governance

GSVI:

Google search volume index

CCI:

Consumer confidence index

GFEVD:

Generalized forecast error variance decomposition

TCI:

Total connectedness index

References

  1. Albuquerque R, Koskinen Y, Yang S, Zhang C (2020) Resiliency of environmental and social stocks: an analysis of the exogenous COVID-19 market crash. Rev Corp Finance Stud 9(3):593–621. https://doi.org/10.1093/rcfs/cfaa011

    Article  Google Scholar 

  2. Ando T, Greenwood-Nimmo M, Shin Y (2022) Quantile connectedness: modeling tail behavior in the topology of financial networks. Manage Sci 68(4):2401–2431. https://doi.org/10.1287/mnsc.2021.3984

    Article  Google Scholar 

  3. Baker M, Wurgler J (2007) Investor Sentiment in the Stock Market. J Econ Perspect 21(2):129–152. https://doi.org/10.1257/jep.21.2.129

    Article  Google Scholar 

  4. Bannier CE, Bofinger Y, Rock B (2022) Corporate social responsibility and credit risk. Financ Res Lett 44:102052. https://doi.org/10.1016/j.frl.2021.102052

    Article  Google Scholar 

  5. Barber BM, Odean T (2008) All that glitters: the effect of attention and news on the buying behavior of individual and institutional investors. Rev Financ Stud 21(2):785–818. https://doi.org/10.1093/rfs/hhm079

    Article  Google Scholar 

  6. Baruník J, Křehlík T (2018) Measuring the frequency dynamics of financial connectedness and systemic risk. J Financ Economet 16(2):271–296. https://doi.org/10.1093/jjfinec/nby001

    Article  Google Scholar 

  7. Bellandi F (2023) Equilibrating financially sustainable growth and environmental, social, and governance sustainable growth. Eur Manag Rev 20(4):794–812. https://doi.org/10.1111/emre.12554

    Article  Google Scholar 

  8. Bollen J, Mao H, Zeng X (2011) Twitter mood predicts the stock market. J Comput Sci 2(1):1–8. https://doi.org/10.1016/j.jocs.2010.12.007

    Article  Google Scholar 

  9. Bollerslev T (1986) Generalized autoregressive conditional heteroskedasticity. J Econom 31(3):307–327. https://doi.org/10.1016/0304-4076(86)90063-1

    Article  Google Scholar 

  10. Broadstock DC, Chan K, Cheng LT, Wang X (2021) The role of ESG performance during times of financial crisis: evidence from COVID-19 in China. Financ Res Lett 38:101716. https://doi.org/10.1093/rcfs/cfaa011

    Article  Google Scholar 

  11. Brundtland Report for the World Commission on Environment and Development (1992) United Nations.

  12. Chang K, Cheng X, Wang Y, Liu Q, Hu J (2021) The impacts of ESG performance and digital finance on corporate financing efficiency in China. Appl Econ Lett. https://doi.org/10.1080/13504851.2021.1996527

    Article  Google Scholar 

  13. Chundakkadan R, Nedumparambil E (2021) In search of COVID-19 and stock market behavior. Glob Finance J. https://doi.org/10.1016/j.gfj.2021.100639

    Article  Google Scholar 

  14. Da Z, Engelberg J, Gao P (2011) In search of attention. J Financ 66(5):1461–1499. https://doi.org/10.1111/j.1540-6261.2011.01679.x

    Article  Google Scholar 

  15. Deng C, Zhou X, Peng C, Zhu H (2022) Going green: Insight from asymmetric risk spillover between investor attention and pro-environmental investment. Financ Res Lett 47:102565. https://doi.org/10.1016/j.frl.2021.102565

    Article  Google Scholar 

  16. Dhasmana S, Ghosh S, Kanjilal K (2023) Does investor sentiment influence ESG stock performance? Evidence from India. Journal of Behavioral and Experimental Finance: 100789. https://doi.org/10.1016/j.jbef.2023.100789

  17. Díaz V, Ibrushi D, Zhao J (2021) Reconsidering systematic factors during the COVID-19 pandemic—the rising importance of ESG. Financ Res Lett 38:101870. https://doi.org/10.1016/j.frl.2020.101870

    Article  Google Scholar 

  18. Diebold FX, Yilmaz K (2012) Better to give than to receive: Predictive directional measurement of volatility spillovers. Int J Forecast 28(1):57–66. https://doi.org/10.1016/j.ijforecast.2011.02.006

    Article  Google Scholar 

  19. El Ouadghiri I, Guesmi K, Peillex J, Ziegler A (2021) Public attention to environmental issues and stock market returns. Ecol Econ 180:106836. https://doi.org/10.1016/j.ecolecon.2020.106836

    Article  Google Scholar 

  20. El-oubani A (2023) Complex adaptive behavior of investors to market dynamics: a PLS-SEM analysis. J Appl Struct Equ Model 7(2):1–25

    Google Scholar 

  21. El Oubani A, Lekhal M (2022) An agent-based model of financial market efficiency dynamics. Borsa Istanbul Rev 22(4):699–710. https://doi.org/10.1016/j.bir.2021.10.005

    Article  Google Scholar 

  22. Fama EF (1970) Efficient capital markets: a review of theory and empirical work. J Financ 25(2):383. https://doi.org/10.2307/2325486

    Article  Google Scholar 

  23. Fang J, Gozgor G, Lau C-KM, Lu Z (2020) The impact of Baidu Index sentiment on the volatility of China’s stock markets. Financ Res Lett 32:101099. https://doi.org/10.1016/j.frl.2019.01.011

    Article  Google Scholar 

  24. Fang L, Yu H, Huang Y (2018) The role of investor sentiment in the long-term correlation between US stock and bond markets. Int Rev Econ Financ 58:127–139. https://doi.org/10.1016/j.iref.2018.03.005

    Article  Google Scholar 

  25. Gao Y, Li Y, Zhao C, Wang Y (2022) Risk spillover analysis across worldwide ESG stock markets: New evidence from the frequency-domain. N Am J Econ Finance 59:101619. https://doi.org/10.1016/j.najef.2021.101619

    Article  Google Scholar 

  26. Garel A, Petit-Romec A (2021) Investor rewards to environmental responsibility: evidence from the COVID-19 crisis. J Corp Financ 68:101948. https://doi.org/10.1016/j.jcorpfin.2021.101948

    Article  Google Scholar 

  27. Giannarakis G, Partalidou X, Zafeiriou E, Sariannidis N (2016) An analysis of United States on Dow Jones sustainability index. Invest Manag Financ Innov 13 Iss. 3 (contin. 2):353–361. https://doi.org/10.21511/imfi.13(3-2).2016.07

  28. Gutsche G, Köbrich León A, Ziegler A (2019) On the relevance of contextual factors for socially responsible investments: an econometric analysis. Oxf Econ Pap 71(3):756–776. https://doi.org/10.1093/oep/gpy051

    Article  Google Scholar 

  29. Hartzmark SM, Sussman AB (2019) Do investors value sustainability? A natural experiment examining ranking and fund flows. J Financ 74(6):2789–2837. https://doi.org/10.1111/jofi.12841

    Article  Google Scholar 

  30. Horváthová E (2012) The impact of environmental performance on firm performance: Short-term costs and long-term benefits? Ecol Econ 84:91–97. https://doi.org/10.1016/j.ecolecon.2012.10.001

    Article  Google Scholar 

  31. Isaak M, Lentz W (2020) Consumer preferences for sustainability in food and non-food horticulture production. Sustainability 12(17):7004. https://doi.org/10.3390/su12177004

    Article  Google Scholar 

  32. Islam MA (2021) Investor sentiment in the equity market and investments in corporate-bond funds. Int Rev Financ Anal 78:101898. https://doi.org/10.1016/j.irfa.2021.101898

    Article  Google Scholar 

  33. Joseph K, Wintoki MB, Zhang Z (2011) Forecasting abnormal stock returns and trading volume using investor sentiment: Evidence from online search. Int J Forecast 27(4):1116–1127. https://doi.org/10.1016/j.ijforecast.2010.11.001

    Article  Google Scholar 

  34. Kim S-H, Kim D (2014) Investor sentiment from internet message postings and the predictability of stock returns. J Econ Behav Organ 107:708–729. https://doi.org/10.1016/j.jebo.2014.04.015

    Article  Google Scholar 

  35. Koop G, Pesaran MH, Potter SM (1996) Impulse response analysis in nonlinear multivariate models. J Econom 74(1):119–147. https://doi.org/10.1016/0304-4076(95)01753-4

    Article  Google Scholar 

  36. La Torre M, Mango F, Cafaro A, Leo S (2020) Does the ESG index affect stock return? Evidence from the eurostoxx50. Sustainability 12(16):6387. https://doi.org/10.3390/su12166387

    Article  Google Scholar 

  37. Lekhal M, El Oubani A (2020) Does the Adaptive Market Hypothesis explain the evolution of emerging markets efficiency? Evidence from the Moroccan financial market. Heliyon 6(7):e04429. https://doi.org/10.1016/j.heliyon.2020.e04429

    Article  Google Scholar 

  38. Li Y, Goodell JW, Shen D (2021) Comparing search-engine and social-media attentions in finance research: evidence from cryptocurrencies. Int Rev Econ Financ 75:723–746. https://doi.org/10.1016/j.iref.2021.05.003

    Article  Google Scholar 

  39. Liu S (2015) Investor sentiment and stock market liquidity. J Behav Financ 16(1):51–67. https://doi.org/10.1080/15427560.2015.1000334

    Article  Google Scholar 

  40. Liu L, Nemoto N, Lu C (2023) The effect of ESG performance on the stock market during the COVID-19 pandemic—evidence from Japan. Econ Anal Policy 79:702–712. https://doi.org/10.1016/j.eap.2023.06.038

    Article  Google Scholar 

  41. Liu Z, Wang S, Liu S, Yu H, Wang H (2022) Volatility risk premium, return predictability, and ESG sentiment: evidence from China’s spots and options’ markets. Complexity. https://doi.org/10.1155/2022/6813797

    Article  Google Scholar 

  42. Lo AW (2004) The adaptive markets hypothesis. J Portf Manag 30(5):15–29

    Article  Google Scholar 

  43. López-Cabarcos MÁ, Pérez-Pico AM, López-Pérez ML (2019) Does social network sentiment influence S&P 500 environmental & socially responsible index? Sustainability 11(2):320. https://doi.org/10.3390/su11020320

    Article  Google Scholar 

  44. Luque-Vílchez M, Gómez-Limón JA, Guerrero-Baena MD, Rodríguez-Gutiérrez P (2023) Deconstructing corporate environmental, social, and governance performance: Heterogeneous stakeholder preferences in the food industry. Sustain Dev 31(3):1845–1860. https://doi.org/10.1002/sd.2488

    Article  Google Scholar 

  45. Malik N, Kashiramka S (2024) Impact of ESG disclosure on firm performance and cost of debt: empirical evidence from India. J Clean Prod. https://doi.org/10.1016/j.jclepro.2024.141582

    Article  Google Scholar 

  46. Mensi W, Al-Yahyaee KH, Vo XV, Kang SH (2021) Modeling the frequency dynamics of spillovers and connectedness between crude oil and MENA stock markets with portfolio implications. Econ Anal Policy 71:397–419. https://doi.org/10.1016/j.eap.2021.06.001

    Article  Google Scholar 

  47. Naeem MA, Farid S, Faruk B, Shahzad SJH (2020) Can happiness predict future volatility in stock markets? Res Int Bus Financ 54:101298. https://doi.org/10.1016/j.ribaf.2020.101298

    Article  Google Scholar 

  48. Nyakurukwa K, Seetharam Y (2023) Investor reaction to ESG news sentiment: evidence from South Africa. Economia. https://doi.org/10.1108/ECON-09-2022-0126

    Article  Google Scholar 

  49. Orsato RJ, Garcia A, Mendes-Da-Silva W, Simonetti R, Monzoni M (2015) Sustainability indexes: why join in? A study of the ‘Corporate Sustainability Index (ISE)’in Brazil. J Clean Prod 96:161–170. https://doi.org/10.1016/j.jclepro.2014.10.071

    Article  Google Scholar 

  50. Ortas E, Moneva JM, Salvador M (2014) Do social and environmental screens influence ethical portfolio performance? Evidence from Europe. BRQ Bus Res Q 17(1):11–21. https://doi.org/10.1016/j.cede.2012.11.001

    Article  Google Scholar 

  51. Pedini L, Severini S (2022) Exploring the hedge, diversifier and safe haven properties of ESG investments: a cross-quantilogram analysis. MPRA Paper 112339, University Library of Munich, Germany. https://ideas.repec.org/p/pra/mprapa/112339.html

  52. Pesaran HH, Shin Y (1998) Generalized impulse response analysis in linear multivariate models. Econ Lett 58(1):17–29. https://doi.org/10.1016/S0165-1765(97)00214-0

    Article  Google Scholar 

  53. Pham L, Cepni O (2022) Extreme directional spillovers between investor attention and green bond markets. Int Rev Econ Financ 80:186–210. https://doi.org/10.1016/j.iref.2022.02.069

    Article  Google Scholar 

  54. Piñeiro-Chousa J, López-Cabarcos MÁ, Pérez-Pico AM, Ribeiro-Navarrete B (2018) Does social network sentiment influence the relationship between the S&P 500 and gold returns? Int Rev Financ Anal 57:57–64. https://doi.org/10.1016/j.irfa.2018.02.005

    Article  Google Scholar 

  55. Piñeiro-Chousa J, López-Cabarcos MÁ, Šević A (2022) Green bond market and Sentiment: Is there a switching Behaviour? J Bus Res 141:520–527. https://doi.org/10.1016/j.jbusres.2021.11.048

    Article  Google Scholar 

  56. Piñeiro-Chousa JR, López-Cabarcos MÁ, Pérez-Pico AM (2016) Examining the influence of stock market variables on microblogging sentiment. J Bus Res 69(6):2087–2092. https://doi.org/10.1016/j.jbusres.2015.12.013

    Article  Google Scholar 

  57. Pitoska E, Katarachia A, Giannarakis G, Tsilikas C (2017) An analysis of determinants affecting the returns of Dow Jones sustainability index United States. Int J Econ Financ Issues 7(3):113–118

    Google Scholar 

  58. Raimo N, Caragnano A, Zito M, Vitolla F, Mariani M (2021) Extending the benefits of ESG disclosure: The effect on the cost of debt financing. Corp Soc Responsib Environ Manag 28(4):1412–1421. https://doi.org/10.1002/csr.2134

    Article  Google Scholar 

  59. Smales LA (2020) Investor attention and the response of US stock market sectors to the COVID-19 crisis. Rev Behav Finance 13(1):20–39. https://doi.org/10.1108/RBF-06-2020-0138

    Article  Google Scholar 

  60. Smales LA (2021) Investor attention and global market returns during the COVID-19 crisis. Int Rev Financ Anal 73:101616. https://doi.org/10.1016/j.irfa.2020.101616

    Article  Google Scholar 

  61. Vuong NB (2022) Investor sentiment, corporate social responsibility, and financial performance: evidence from Japanese companies. Borsa Istanbul Rev 22(5):911–924. https://doi.org/10.1016/j.bir.2022.06.010

    Article  Google Scholar 

  62. Wan J, Yin L, Wu Y (2024) Return and volatility connectedness across global ESG stock indexes: evidence from the time-frequency domain analysis. Int Rev Econ Financ 89:397–428. https://doi.org/10.1016/j.iref.2023.10.038

    Article  Google Scholar 

  63. Yousaf I, Youssef M, Goodell JW (2022) Quantile connectedness between sentiment and financial markets: evidence from the S&P 500 twitter sentiment index. Int Rev Financ Anal 83:102322. https://doi.org/10.1016/j.irfa.2022.102322

    Article  Google Scholar 

  64. Yu H, Liang C, Liu Z, Wang H (2023) News-based ESG sentiment and stock price crash risk. Int Rev Financ Anal 88:102646. https://doi.org/10.1016/j.irfa.2023.102646

    Article  Google Scholar 

  65. Zhang X, Fuehres H, Gloor PA (2011) Predicting stock market indicators through twitter “I hope it is not as bad as I fear.” Procedia Soc Behav Sci 26:55–62. https://doi.org/10.1016/j.sbspro.2011.10.562

    Article  Google Scholar 

Download references

Acknowledgements

Not applicable.

Funding

No funding was received from any organization.

Author information

Authors and Affiliations

Authors

Contributions

All aspects of the study were done by the author.

Corresponding author

Correspondence to Ahmed El Oubani.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The author declares that he has no competing interests.

Additional information

Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

El Oubani, A. Investor sentiment and sustainable investment: evidence from North African stock markets. Futur Bus J 10, 68 (2024). https://doi.org/10.1186/s43093-024-00349-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s43093-024-00349-x

Keywords

JEL Classification