Building stock market resilience through digital transformation: using Google trends to analyze the impact of COVID-19 pandemic – Frontiers of Business Research in China

Phase 1 results

The main innovation of the methodology employed in this study is the shift from comparing descriptive indicators among firms to clustering of time series indicators based on stock performance. The clustering of firms is based on how their market capitalizations change along with market sentiment towards the pandemic. This allows firms that perform similarly to be identified and also to discover the common attributes shared among the proximate firms. The identified clusters are further explored to understand the underlying reasons for the common patterns they exhibit. Liao (2005) provides a complete view of the available time series clustering approaches. Three major categories of clustering techniques have been adapted to cope with time-series data. It consists of partitioning, hierarchical, and model-based methods. According to Liao (2005), the most available time-series clustering approaches are in general variations of k-means or hierarchical clustering with a range of specified dissimilarity functions designed for the problem. A combination of clustering method and dissimilarity measures is deemed feasible and appropriate to analyze our dataset and address the research problem. Common methods like k-means, fuzzy c-means, and self-organizing maps work better with time series of equal length, which means all data points to be filled across the same period. However, hierarchical clustering applies to time series with unequal length when an appropriate distance measure like Dynamic Time Warping (DTW) distance is chosen to compute dissimilarity (Paparrizos and Gravano 2017). This combination is more applicable to our dataset because not all the firms traded on the same days during the observed period. Thus, this study uses a combination of hierarchical clustering and SBD, which is a faster alternative to DTW (Sardá-Espinosa 2019).

The hierarchical clustering method is a tree-based technique that groups objects into a tree hierarchy of clusters in an agglomerative or divisive manner (Hastie et al. 2009). The agglomerative method treats each object as an individual cluster and iteratively groups clusters into larger clusters based on the pairwise similarity measures. It only stops when all objects fall into a single cluster or meet certain criteria, e.g., reaching the maximum number of clusters. The divisive method starts from a single big cluster that contains all objects and splits the cluster iteratively until each object belongs to an individual cluster. The SBD was proposed by Paparrizos and Gravano (2017) based on the normalized cross-correlation (NCC). It ranges from 0 to 2, with 0 representing perfect similarity. The distance can be obtained from Eq. (1). We adopt SBD to be the distance measure and the shape extraction to define centroid with a z-normalization preprocessing (Sardá-Espinosa 2019).

$$ SBD\left(x,y\right)=1-\frac{\max \left( NCCc\left(x,y\right)\right)}{{\left\Vert x\right\Vert}_2{\left\Vert y\right\Vert}_2} $$


Hierarchical clustering requires a decision of the optimal number of clusters, which can be subjective. It is recommended to evaluate the clustering performance based on the cluster validity indices (CVIs) (Arbelaitz et al. 2013; Lei et al. 2017). Among the commonly used crisp CVIs, internal indices are to evaluate cluster purity, and the external CVIs are used to cross-check the results with a known correct clustering result. A summary of the common CVIs and the evaluation criteria is shown in Table 2.

Table 2 Cluster validity indices

Full size table

Following the above-stated method, the data are tested across different numbers of clusters, ranging from two to seven clusters via an R package proposed by Montero and Vilar (2014). The results are shown in Table 3. A majority of the CVIs indicate that the optimal number of clusters is at two. There are 742 firms in Cluster 1 and 1154 firms in Cluster 2.

Table 3 Results of CVIs

Full size table

By analyzing the extracted centroid, the times series patterns of the two clusters are then examined. For firms in Cluster 1, it is observed that a steeper declining trend of market capitalization occurs amid the COVID-19 outbreak. This is thus termed as the Sensitive Cluster. That is, these firms are likely to be more sensitive to the pandemic. In comparison, firms in Cluster 2 are found to be more resilient to the pandemic with a flatter market capitalization curve both pre and post the declaration of the pandemic by the World Health Organization (WHO) on March 11, 2020. Thus, this cluster is named as the Resilient Cluster.

The firms are cross-tabulated with percentages of their market capitalization decline under the Sensitive Cluster and the Resilient Cluster, with a high, medium, and low level of digital transformation following the MGI Industry Digitalization Framework, to answer the research question and to validate the sectoring. To further simplify the research model and to enable in-depth investigation in Phase 2, Categories 2 to 5 in the original MGI Industry Digitalization Framework, which represent sectors with the potential to transform digitally further, are merged into one group of firms with a medium level of digital transformation. Firms under the most digital sectors (Category 1) and the most lagging sectors (Category 6) are left unchanged. It is then analyzed to assess if the level of digital transformation is associated with the two identified clusters. A descriptive summary of the sensitive and resilient clusters can be found in Table 4.

Table 4 Summary of performance

Full size table

Consistent with expectation, more than two-thirds of the firms (68%) within the most digitally transformed sectors, such as telecommunications equipment, personal services, financial conglomerates, and advertising/marketing services, fall under the Resilient Cluste. The majority of the firms in the lowest rung (60%), including agriculture, hotels, and healthcare, fall under the Sensitive Cluster. Firms with mid-level of sectoral digital transformation fall in between, with about half of the firms (48%) being in the Resilient Cluster. Additionally, Pearson χ2 statistic is used to test the two-way associations with frequencies in the cells (χ2 (1) =16.667, p < 0.05). The results provide some directional support to the relative impact of digital transformation. It also validates the relevance of the level of digital transformation (high, medium, and low) as a grouping variable to be used in the analysis in Phase 2.

Phase 2 results

Google trends index represents the search volume of keywords by Google users, and it serves to indicate market sentiment and the public’s attention to an event or incident (Liu et al. 2019). We apply the Google search index on “coronavirus” as a variable of interest. The other set of variables are the average daily stock price differences between the three groups of firms with a high, medium, and low level of digital transformation derived from Phase 1. We use a VAR model (e.g., Deng et al. 2018; Liu et al. 2019; Tetlock 2007) to test the mutual causality relationship between Google trends and stock price differences. One direction is to estimate the effects of the Google search trends on the stock price fluctuations for each group of firms. The other direction is to test if the stock price differences induce or reduce public attention on the incident. We also investigate the timing and duration of such impacts. An overview of the Phase 2 analysis is shown in Fig. 3. The algorithm is implemented via R.

Fig. 3figure 3

Analysis process: Phase 2

Full size image

Firstly, it examines the relationship between the Google search index and the stock price fluctuations, including the direction and the timing of the effects through Granger causality and VAR model. From the plotted pair of variables, the stock price change, and the adjusted Google search index for coronavirus (the original index/100), a negatively correlated movement of the two variables for the three groups of firms is observed. Stock prices move downwards when the search for coronavirus increased. We do not test correlation, given that it does not necessarily reflect causality, and Granger causality is used to test the leading relationship between these two variables. However, the typical Granger causality test cannot be relied on when one or both time series are non-stationary, which could lead to spurious causality (He and Maekawa 2001). Thus, an Augmented Dickey-Fuller (ADF) test is employed. Besides, a Kwiatkowski-Phillips-Schmidt-Shin (KPSS) test in which the null hypothesis is stationarity is also conducted as a cross-check.

Additionally, the worldwide plunge in stock markets in early March 2020 could be partially attributed to the worst oil price collapse after an all-out price war erupted among the world’s biggest producers. The oil price war could further spark market anxiety, adding to virus worries. To factor in the impact of public attention on oil price, which fluctuated during the research period, we also include the Google search index for “oil”Footnote 1as a control variable, which might exert an impact on stock performance. Table 5 summarizes the ADF and KPSS statistics for the Google search index for coronavirus and oil and the average day-on-day stock price changes for each group of firms. This reveals that the first-order difference of these variables complies with the stationarity assumption required for Granger causality. Although our research interest is to investigate the causality relationship between Google search index for coronavirus and the average day-on-day stock price changes, we still test for the Google search index for oil to check the stationarity of the time series inserted into the model. This determines the order of integration and time-series models following the Toda-Yamamoto (TY) (Toda and Yamamoto 1995) procedure.

$$ {Y}_t={a}_0+{a}_1{Y}_{t-1}+..\dots +{a}_p{Y}_{t-p}+{b}_1{X}_{t-1}+..\dots +{b}_p{X}_{t-p}+{e}_1{Z}_{t-1}+..\dots +{e}_p{Z}_{t-p}+{u}_{t.} $$


$$ {X}_t={c}_0+{c}_1{X}_{t-1}+..\dots +{c}_p{X}_{t-p}+{d}_1{Y}_{t-1}+..\dots +{d}_p{Y}_{t-p}\kern0.5em +{v}_{t.} $$


Table 5 Tests of ADF and KPSS

Full size table

In Eqs. (2) and (3), Yt represents the average day-on-day stock price change in percentage, Xt and Zt represent the Google search index of the keyword coronavirus and oil, respectively. Meanwhile, p is the lag order, and ap, bp, cp, dp, ep, are the coefficients of Yt-p, Xt-p, and Zt-p. Additionally, a0 and c0 are the constant terms and ut and vt are the error terms. The null hypothesis for Eq. (2) is H0: b1 = b2 = … = bp = 0, and the alternative hypothesis is HA: Not H0. When H0 is rejected, X is the Granger-cause of Y. Similarly for Eq. (3), H0: d1 = d2 = … = dp = 0, against HA: Not H0, is to test the hypothesis that Y does not Granger-cause X. To interpret the equations, we are to test if Y could be better predicted by the histories of its own and X than its history. If H0 could be rejected, then it implies a Granger causality. We did not explicitly build the hypothesis for effect between Yt and Zt, because the research question is to investigate whether there is a causal relationship between market performance and public attention to coronavirus.

As shown in Table 5, the first-order difference of variables X, Y, and Z removes the unit root. Thus, the maximum order of integration is set to be 1, denoted by I (1). As a next step, the VAR model is set up using the levels of the data without differencing and determining the appropriate lag length for the variables X and Y. Based on the information criteria of Akaike Information Criterion Hannan Quinn, Schwarz Criterion, and Final Prediction Error, it is decided that six lags are used in the analyses that followed. As noted by Toda and Yamamoto (1995), the advantage of the TY method is to save the co-integration test and prevent pretest bias. However, there is a need to ensure that the VAR model is specified in a way that there is no serial correlation in the residual value. From the results of a Portmanteau test controlling for dynamic stability, it is observed that Lag 6 removes residual serial autocorrelation for all three groups.

After carrying out the tests for misspecification, the VAR model with Lag 6 is chosen, and one additional lag into each variable is added to Eqs. (2) and (3), given the maximum order of integration I(1). Therefore, an augmented VAR model for Eqs. (2) and (3) is constructed, respectively. This is followed by a Wald test, whereby the hypotheses that the coefficients of the first six lagged values of X in Eq. (2) and the coefficients of the first six lagged values of Y in Eq. (3) are 0 are tested. The reason not to include the coefficient of the 7th lag is that the additional lagged value is to fix the asymptotic so that the Wald test statistics would be under the null hypothesis that it follows asymptotical chi-square distribution. Rejection of the null hypothesis of the Wald test implies a Granger causality. The results are shown in Table 6.

Table 6 Test of Granger causality

Full size table

Table 6 shows that Google search trends affect the stock price fluctuation of firms in all three groups, which confirms our earlier prediction. The stock price changes of firms in Groups 1 and 2 also affect Google search trends, but not Group 3. These results indicate that the changes in stock prices for firms in Groups 1 and 2 can trigger fluctuations in market sentiment. However, the magnitude and the directions of such impact await further investigation from the augmented VAR models, summarized in Tables 7 and 8.

Table 7 The results of the augmented VAR estimation: Eq. (2)

Full size table

Table 8 The results of the augmented VAR estimation: Eq. (3)

Full size table

As the focus is on the impact that Google searches impose on stock price changes and also to differentiate the impact across the different groups, a detailed investigation into the results of Eq. (2) is then conducted. Consistent with our prediction, Google search trends are positively related to the stock price changes of Group 1, lagged by two periods (2 days). On the other hand, results also show that Google search trends have a one-period lagged negative impact on the stock price changes of Groups 2 and 3. In other words, the relationship between Google search trends and the stock performance of Group 1 rather different than the other two groups. Google search trends can cause negative changes in the stock performance of firms in Groups 2 and 3, with a shorter time lag. In sum, there is strong evidence to show that the digital transformation of firms mitigates the negative impact of market sentiment due to large-scale unanticipated incidents on stock performance. Furthermore, as stock prices dip amid the coronavirus pandemic, firms with mid to high level of digital transformation have out-performed others.

The results of Eq. (3) examine the impact of stock price changes for each group of firms on Google search trends. As indicated in Table 8, it is observed that stock price changes trigger changes in the Google search trend in the opposite direction. Stock price increase in Group 1 will drive a decline of Google search with a lag of seven periods. Similar relationships are observed in Groups 2 and 3. That is, a decline in stock price during the coronavirus outbreak could be easily attributed to the pandemic by the investors, which may further arouse market-wide concerns over the pandemic. Such concerns over the spread of COVID-19 and economic outlook can translate into a higher Google search volume. The impact on Google search trends is strongest for firms in Group1 and weakest for firms in Group 3, with Group 2 falling in the middle.

Leave a Comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: