An Empirical Study of Macroeconomic Factors and Stock Returns in the Context of Economic Uncertainty News Sentiment Using Machine Learning

Stockmarkets accurately reflect countries’ economic health, and stock returns are tightly related to economic indices. One popular area of financial research is the factors that influence stock returns. Several investigations have frequently cited macroeconomic factors, among numerous elements. 'erefore, this study focuses on the empirical analysis of the relationship between macroeconomic factors and stock market returns. When a stock market becomes increasingly volatile, it becomes susceptible to economic uncertainty news, and information on social media platforms. 'us, we incorporated a new dimension of economic uncertainty news sentiment (EUNS) for stock return predictions. We employed the daily data ofgold index, crude oil price, interest rate, exchange rate, and stock returns for a set of countries from January 2010 to December 2020. Subsequently, to compute coefficients, we conducted a regression analysis using one of the more sophisticated approaches: single-layer neural networks and ordinary least square regression. In addition, we only computed EUNS for the period of the fiscal budget announcement for the US, Turkey, and Hong Kong. 'e results indicate that the gold index, interest rate, and exchange rate are highly significant and negative macroeconomic factors for all analyzed countries. 'ese findings also indicate that EUNS is important and detrimental for projecting stock returns.


Introduction
In today's global world, stock market performance is quite crucial for economic stability and growth. On the other hand, stock markets are also sensitive to economic conditions and uncertain events. Economists contend that the stock market is a leading indicator of economic growth. When the stock market does well, it indicates that the economy is working according to plan. For instance, it is indicated in existing studies that there have been positive influences on the economic growth of countries caused by the capitalization of stock markets [1]. Moreover, it has also been well-researched that several macroeconomic factors, business financial outcomes, and political events have a greater influence on stock markets [2]. Similarly, any economic news on various social media platforms, in either positive or negative terms, can also significantly influence stock markets [3,4]. Stock market forecasting and analyses of stock returns under different factors have long been a classic but difficult research area, attracting the interest of both economists and computer scientists [5].
e highly volatile nature of the stock market attracts researchers to explore the underlying factors that result in these movements. Moreover, investors must keep track of the key factors that affect stock returns. Investors need to pay attention to crucial macroeconomic indicators to earn optimal returns on their portfolios. erefore, stock market prediction is very important for investors and policymakers [6]. In a financially risky marketplace, it is crucial to make very specific predictions about stock returns. Accurate stock prediction leads to market developments, guides investment strategies, and enlightens paths toward optimized stock trading. Stocks are considered one of the most sensitive assets in any economy [7]. Any aggressive variation in the stock market can negatively influence the economy. e main reasons for this risk are market irregularities, uncertainties, and volatility [8,9]. In this context, stock forecasting tends to be a crucial task because fluctuations in the economy are sometimes quite drastic and sudden, which may lead to a fall in stock markets [10,11].
More specifically, various complicated economic factors and scenarios affect stock returns. Research indicates many key factors that affect share prices, including interest rates, exchange rates, company performances, political situations, current events, economic conditions, market psychology, natural disasters, and government policies [12][13][14][15]. Macroeconomic variables are theoretically considered the main source of stock volatility. Subsequently, these factors are the main indicators of stock returns [16]. ese variables make stock prices unstable and challenging to anticipate with high precision. e existing literature includes many approaches suggested by various researchers for stock price prediction tasks. Some research studies have employed historical stock data on various stock markets to make predictions [17]. However, some studies have also employed social media analytics information, such as general sentiment, news, and sentiment regarding specific events [18], to conduct stock market analyses. More precisely, these events include the coronavirus disease 2019 (COVID-19) [19], the British exit from the European Union (Brexit) [20], and the 2019 Nigerian presidential election [21]. In both approaches, the social media-based analysis of big data regarding stocks has gained substantial attention over the past few years [18,22] because this provides more clarity to investors for improved planning and decision-making. All these stock market prediction-related tasks have been accomplished using several approaches. Whenever any political or unpredictable event happens, it effects the stock market twofold. First, there is a direct effect on the economy because such events become the drivers of future economic and political policies. As a result of this set of policies, macroeconomic indicators fluctuate and affect the stock market [23]. Second, social media reaction to such events accelerates the impact on the stock market through the sentiment triggered by social media. In this context, it is inevitable to investigate the impact of macroeconomic indicators and social media sentiment on stock returns in special circumstances.
Hence, the major research questions are the following: what if stock return analysis is performed using macroeconomic factors by employing the most sophisticated machine learning approaches (i.e., single-layer neural networks)? Second, what is the influence on the accuracy of stock returns if economic uncertainty news sentiment (EUNS) is incorporated alongside macroeconomic factors? erefore, compared to the existing methods, this study provides a more in-depth stock market analysis given macroeconomic factors and EUNS using single-layer neural networks instead of traditional statistical and regression approaches. Furthermore, the existing studies [2,24,25] have analyzed the stock markets of a specific country in terms of macroeconomic factors, whereas this study assesses the stock markets of three well-established countries: Hong Kong, the US, and Turkey. We focus on four key macroeconomic factors, namely, the interest rate, crude oil price, exchange rate, and gold index to check their impact on stock returns for Turkish, Hong Kong, and US companies' stock data. We collected the stock dataset from January 2010 to December 2020 to evaluate the model. We selected the top five performing stocks in these three stock markets based on their trading volume. Furthermore, to investigate the impact of social media sentiment, we constructed an index based on economic uncertainty news on Twitter. We extracted tweets from Twitter regarding certain keywords, namely, "foreign debt," "trade balance," "budget deficit," "exchange rate depreciation," "the law in order," "war on terror," "financial crisis,""political instability," "trade sanctions," "financial sanction," "turmoil period," and "economic downtime." is set of key words establishes an economic uncertainty news sentiment, which is later used as an independent variable to explain stock market returns. Subsequently, a single-layer neural network that is a time-series model is used to investigate the relationship between the exchange rate, interest rate, crude oil price, gold index, the sentiment of economic uncertainty, and stock returns. e contributions of this study are addressed below: (i) A single-layer neural network is employed to investigate the influence of macroeconomic variables on stock returns, which is quite rare in this context. (ii) We construct a Twitter sentiment of economic uncertainty news by applying textual analysis using a Twitter dataset. (iii) We incorporate sentiments related to economic uncertainty news on Twitter into the model to explore their influence on stock returns in the US, Turkey, and Hong Kong.
e remaining sections are arranged as follows: After the introduction, the Related Work section presents the literature review. e third section explains the methodology, and the fourth section reports the results and discussion, followed by the conclusion.

Related Work
In this section, we review the task of stock forecasting to examine stock market trends and discuss the literature on studies of the influence of macroeconomic variables on stock returns. is section also emphasizes the many methodologies used in stock market analysis.  [27]. e data employed in this study are also historical, and closing prices are predicted using machine learning algorithms. Ayala et al. [28] suggested several machine learning approaches, including linear regression, support vector regression, artificial neural networks (ANNs), and moving average-based methods. ey tested the trading data from three indices which included Ibex35, DAX, and Dow Jones Industrial. Likewise, Mokhtari et al. [29] exploited machine learning approaches for stock market prediction in terms of buying, selling, and holding stocks. ey performed both fundamental and technical analyses on the stock, along with feature selection and data-cleaning methods, to improve performance.

Stock Market Analysis Using Deep Learning Methods.
Other than traditional machine learning methods, some researchers have also proposed deep learning-based advanced algorithms in the financial domain of stock data because these techniques perform well in diverse domains [30][31][32]. For example, Hiransha et al. [33] proposed four kinds of deep neural networks, namely, MLP, recurrent neural networks, long-short-term memory (LSTM) networks, and convolutional neural networks (CNNs) for stock market predictions using historical data. e stock data came from two stock exchanges: the National Stock Exchange of India and the New York Stock Exchange. Nikou et al. conducted a comparative study of machine learning and deep learning approaches for stock market predictions. e data in their study included the closing prices of the iShares MSCI United Kingdom exchange-traded fund. eir analysis observed that deep learning techniques work better than traditional machine learning approaches. Moghar and Hamiche suggested the LSTM model to predict future stock prices [34]. e primary goals of this study were to determine the precision with which a machine learning model can forecast and the number of epochs required to train a model. Sunny et al. [35] proposed a bidirectional LSTM model to predict the stock market.
ey validated their suggested model on publicly available datasets of stocks.

Stock Market Analysis with Sentiment Data.
In contrast to the above-mentioned studies, some researchers have exploited the data based on sentiments to examine their influence on stock market predictions. For instance, Li et al. [36] incorporated stock prices and sentiments to perform stock predictions. Both sources of information were input into an LSTM model separately to estimate the stock return values. Jin et al. [10] involved investor sentiments in predicting stock prices by employing an attention-based LSTM model that focuses on more meaningful information. Furthermore, using empirical modal decomposition, they progressively deconstructed a complicated series of stock prices. Moreover, their results demonstrated that investors' emotional tendencies are useful for improving expected outcomes. Additionally, the influence of certain megaevents, such as the COVID-19 pandemic, on various stock markets has also been analyzed. For instance, Lee [19] exploited the influence of COVID-19 on US stock markets.
is study investigated whether the Daily News Sentiment Index forecasted US industrial returns differently by designing a regression model in which the dependent variable was the industry's excess returns.
Gupta et al. [37] also suggested fusing historical data with sentiment data to accurately forecast the future of financial stocks. e model they designed is an LSTM model that best models the trends of future stock prices. e latest studies have also employed optimization-based methods combined with deep learning models to acquire more optimized values for stock prices during forecasting. For instance, Chung and Shin optimized architectural elements of the LSTM model, such as window size, with a genetic algorithm (GA) [38] because these structural elements play an important role in improving the performance of LSTM and ultimately significantly influence forecasting of stock prices.
is study aimed to analyze the temporal characteristics of stock market data by proposing a structured technique for determining the time window size and architecture for the LSTM model. Similarly, Chung and Shin optimized the model topology using a GA; however, the underlying model was a CNN [39]. eir study indicated that a hybrid of CNN and GA outperformed the existing stock market prediction methods. Zhang et al. proposed a novel algorithm with the most advanced approach (i.e., generative adversarial networks with MLP as the discriminator model) that incorporates an LSTM model as a generator to predict stock prices [40]. e aim of the generator model built using LSTM was to extract the stock data distributions from the supplied stock data and then produce the same data, whereas the discriminator aims to differentiate between actual and generated stock data. Moreover, the latest research into stock trading and forecasting strategies exploits the application of deep reinforcement learning algorithms [41].

Analysis of Stock Returns with the Influence of Macroeconomic Variables.
e mentioned studies conducted stock forecasting-related tasks using historical data, such as the open price of a stock and its high and low prices. However, these indicators are very basic because the stock market is quite sensitive and exposed to macroeconomic factors (e.g., the exchange rate, oil price, interest rate, and gold price) [42]. e effect of macroeconomic variables on the stock market is highly linear. e exchange rate of the stock market has a positive correlation with these external or macroeconomic variables, but this can vary between different markets and periods. Any general changes, such as Complexity 3 foreign investment restrictions, induce changes to the stock market. erefore, investigating the relationship between the stock exchange and macroeconomic variables is important [43]. In this respect, several pieces of research have been conducted to address the relationship between macroeconomic variables and stock market returns. Some have found a relationship between macroeconomic variables in the stock market, such as the real gross domestic product, aggregate price level, exchange rate, money supply, interest rate, and production index [44]. e interest rate, inflation, and money supply have a bidirectional relationship with stock returns [45]. News sentiments are also a significant variable when estimating stock market returns [46].
Moreover, contradictory results are reported in the existing literature regarding the relationship between these variables. e relationship is quite dynamic and varies between countries [47]. Specifically, in the context of macroeconomic factors, Celebi and Hönig analyzed the German stock index in terms of the influence of macroeconomic factors [2]. ey used data covering 27 years, and the results reported in this work indicate that many macroeconomic factors had a major influence on stock returns during precrisis and post-crisis times. Similarly, Omodero and Mlanga analyzed macroeconomic variables in Nigeria's stock markets using the regression method [48]. eir investigation revealed that the exchange and interest rates have no substantial influence on the share price index. However, the inflation rate has a considerable detrimental influence on the share price index. Likewise, Ndlovu et al. [25] and J. Khan and I. Khan [24] worked on the stock exchanges of Johannesburg and Karachi to study the influence of macroeconomic variables.
ese studies involved several statistical analysis techniques and tests, such as the autoregressive distributed lag model, to examine the influence. Khan et al. observed that the money supply, exchange rate, and interest rate are essential macroeconomic variables that affect stock returns. In recent times, neural network models to investigate the relationship between macroeconomic variables and stock returns have been quite rare. erefore, this study uses this model to empirically investigate the relationship between the gold index, crude oil price, interest rate, exchange rate, EUNS, and stock market returns.

Materials and Methods
is section elaborates on the dataset in this study and discusses the methodological steps to conduct the study. We describe the data collection procedure for analysis in the first stage and provide a step-by-step explanation to illustrate how the acquired data are used to study the influence of macroeconomic variables and EUNS on stock market returns for three nations. Figure 1 depicts a representation of the methodology.

Data Collection.
To assess the performance of the proposed model on historical stock data for technical analysis, we take daily data from the top five performing stocks in the Standard and Poor's 500, the Hong Kong stock exchange, and the Borsa Istanbul stock exchange, as listed in Table 1. Similarly, the currency rate, interest rate, gold price, and crude oil price are all considered to be macroeconomic variables.
e data were acquired from January 2010 to December 2020. Subsequently, for the fundamental analysis, we employ sentiment analysis on tweets indexed against several keywords, including "foreign debt," "trade balance," "budget deficit," "exchange rate depreciation," "the law in order," "war on terror financial crisis," "political instability," "trade sanctions," "financial sanctions," "turmoil period," and "economic downtime."

Proposed Model for Technical and Fundamental Analyses of Stock and Sentiment Data with Macroeconomic Variables.
After data acquisition, a model based on deep neural networks was designed to perform regression and estimate the coefficient values for macroeconomic variables and EUNS.
Equations (1) and (2) compute the values of the coefficients. (2) In the above equations, G i , C o , I r , E x , and S represent the gold price index, crude oil price, daily interest rate, exchange rate, and EUNS, respectively. Specifically, the neural network technique is used for the linear regression problem.
Generally, linear regression refers to the set of problems in which we want to model the relationship between dependent and independent variables. is method is one of the most popular supervised machine learning algorithms in which the projected output is continuous and the slope indicates constant learning. Linear regression is classified into simple and multiple linear regression. Simple linear regression has only one independent variable and a bias term. However, multiple linear regression must have more than one independent variable. ese regression problems can be formulated with the most sophisticated machine learning algorithms (i.e., ANNs). Also known as connectionist systems, these ANNs are inspired by the structure of the human brain and are very efficient approaches for designing predictive or regression models. ese neural networks enable several machine learning algorithms to coordinate and handle complex inputs. Due to these characteristics, an algorithm can accomplish tasks, and the underlying algorithm is not usually designed with any taskspecific rules. For instance, in computer vision, the system can perform image recognition and object detection in different domains [49,50]. However, these tasks use the most advanced variants of ANNs (i.e., CNNs and objectdetection models).
In fact, ANNs are a strong tool for determining the association between input and output variables, which can be accomplished by training the ANNs on a large set of training records containing input and output data. Generally, the ANN architecture consists of units or nodes with 4 Complexity weighted connections between them, where each unit introduces and conveys certain information to the network. is method works by rst taking a vector of inputs, such as X (x 1 , x 2 , x 3 , . . . , x n ), and generating a predictive model with the help of a mathematical function. In the next stage, the ANN starts learning by ne-tuning the weights present on connections between neurons, followed by measuring the model error, which is the di erence between the projected model output and the actual values. is process is repeated many times or for a set number of epochs until it nds a model with an error near zero. Using ANNs, we can model any real-world problem because they are self-adaptive. ey can be single-layer or multi-layer neural networks. We employed a single-layer network with only one input and one output layer to model the regression problem. A model is designed to take inputs of independent variables as a set and learn to nd the best weights such that the value of the dependent variable and model outputs are nearly equal. In this case, these independent variables are macroeconomic variables' sentiment values. We consider the following simple linear regression function, given in the following equation: In the above equation, x 1 , x 2 , x 3 , and x n are independent variables or features in a given input vector. In addition, w 1 , w 2 , w 3 , and w n are the coe cients and weights of the predictive model, and w 0 is the bias term. e proposed architecture is divided into one input and one output layer. e number of units in the input layer equals the total number of independent variables, and the output layer has one unit. ere are direct connections between every input and the output units and associated weights. e neural network optimizes these weights throughout every iteration using the Adam optimizer. is algorithm calculates the individual learning rates for di erent parameters. Moreover, to adapt the learning rates, the rst and second moments of the gradient are also calculated for each coe cient or weight of the model. e expected value of the random variable is de ned as its moment, as indicated in equation: is random variable is used to represent the loss function of the neural network. Furthermore, after one iteration nishes, the weights or coe cients of the linear regression model are updated using the weight update equation described in equation (5) for all weights (i.e., w 0 , w 1 , w 2 , w 3 , and w n ).
where W n−1 is the value of the old weight, η is the step size, and the values of m t and vt, which represent the moments  Complexity and variance, are calculated by equations (6) and (7), respectively.
where β 1 and β 2 are the hyperparameters in equations (6) and (7), and equations (8) and (9) are used to calculate m t and v t .
e first moment is the mean m t , and the second moment is the variance v t . Furthermore, when the model converges and determines the best coefficients after updating the weights individually in every iteration, after the last iteration, the weights or coefficients are extracted and stored. e optimized loss function is the mean squared error function, defined as follows: In equation (10), N denotes the total number of instances in stock data, Y i is the actual value of the dependent variable, and Y i represents the predicted value of the dependent variable. In the following stage, for each unobserved data point, we load the stored coefficients and multiply them by the relevant dependent variables to obtain the required value of the dependent variable. Figure 2 depicts the proposed model.

Results and Discussion
is section presents the results for all three selected countries (i.e., the US, Turkey, and Hong Kong) and a theoretical discussion. Subsequently, we compared existing studies regarding macroeconomic variable analysis with stock returns. Table 2 lists the descriptive statistics for all macroeconomic variables for the US. e columns in Table 2 indicate all macroeconomic variables, and the rows display the mean, median, standard deviation, Jarque-Bera value, and a number of observations. Last, Table 4 presents the descriptive statistics of variables, including the interest rate and exchange rate for Hong Kong. e Jarque-Bera test reveals that all these variables have a non-normal distribution. e exchange rate has the greatest Jarque-Bera value, and the index rate has the lowest. For the index return, interest rate, and exchange rate, the mean values are 2.368, 0.385, and 2.582. In addition, the standard deviation values are lower for all variables, including the index return, interest rate, and exchange rate, which indicate fewer fluctuations in the overall observations.

Results with the Augmented Dickey-Fuller Unit Rate Test.
If the number of observations is compared with the previous two nations, the overall number of observations for Hong Kong is greater than that for the US and Turkey. Generally, non-stationarity is a prevalent issue with time-series data. More explicitly, when the mean and standard deviation are time-dependent, it causes a "unit root problem." e augmented Dickey-Fuller (ADF) test analyzes the unit root problem. e ADF test investigates the unit root hypothesis against the alternative of no unit root. When the problem of unit root exists, the data are considered nonstationary, causing bias in the estimated parameters. Table 5 provides the results of the ADF test.
e results indicate that most stock return data and exchange rates are stationary at the first level, whereas the interest rate, crude oil price, and gold index are stationary at the first difference. In Table 5, the first column lists the variables. e second and third columns present the values of the ADF test with the first differences, whereas the last column displays the critical values at 5%. ese values were computed for each country and their respective stock returns. us, this ADF test appropriately demonstrates the proper stationarity of time-series data for these nations.

Regression Results and Computation of Coe cients.
To compute the regression results and calculate the coecients, we used (1) to investigate the in uence of macroeconomic variables, including the gold index (G i ), crude oil price (C o ), interest rate (I r ), and exchange rate (E x ). Similarly, equation (2) investigates the in uence of economic news (S) sentiment on stock returns for all countries. In the rst stage, the in uence of the gold index, crude oil price, interest rate, and the exchange rate was analyzed on the stock returns of the US stock market without involving the sentiment of the economic news (S). For this purpose, we used the stock returns of the top ve performing companies along with the Standard and Poor's 500 index. Table 6 lists the results for each country.
Each column in Table 6 provides the coe cient value for each macroeconomic variable. Moreover, the rows indicate     Table 6 provides the values of coefficients for other companies also. e findings suggest that the influence of the gold index, oil price, interest rate, and exchange rate is highly significant and negative. As a result, any positive shock in the exchange rate causes stock returns to rise. Similarly, an increase in the gold index causes the stock return to decrease because the gold index is a relatively less risky option for investors. ese results align with the existing literature (e.g., [51][52][53][54]). Subsequently, we employ equation (2) to investigate the influence of the gold index, crude oil price, interest rate, exchange rate, and sentiment of economic news on stock returns in the US stock market. For comparative analysis, we also report results of estimated coefficients based on OLS (Ordinary least square). All the coefficients are mostly negative and significant. However, the SLP model outperforms the OLS because most of the coefficients are highly significant, unlike the OLS. Table 7 presents the results that include sentiment as another variable. Like Table 6, the columns indicate the coefficient values, including the coefficient of sentiment, and the rows indicate the companies. For instance, the first row   e findings suggest that the gold index, interest rate, and exchange rate have highly significant and negative influences. All the coefficients of these variables are negatively significant at the 1% level, and any positive shock in the exchange rate causes the stock returns to increase. e coefficient of social media sentiment toward economic news is highly significant and negative at the 5% and 1% significance levels. e statistical significance of the EUNS indicates that during the period of a fiscal budget announcement, any economic uncertainty news negatively influences stock returns. For comparative analysis, we also report results of estimated coefficients based on OLS (ordinary least square). All the coefficients are mostly negative and significant. However, the SLP model outperforms the OLS because most of the coefficients are highly significant, unlike the OLS.
In the second experiment, we assessed the values of coefficients for Turkey with two experimental settings. In the first setting, we used (1) to investigate the influence of the gold index, crude oil price, interest rate, and exchange rate on stock returns in the Turkish stock market without including sentiment as a variable. We used the stock returns of the top five performing firms and the BIST 100 index. Table 8 presents the findings. e columns in Table 8 Table 8 present the values of coefficients for the remaining top five firms in Turkey. According to the results, the coefficients for the interest and exchange rates are extremely significant and negative. Any positive shock in the exchange rate leads to increased stock returns. Similarly, an increase in the interest rate causes stock returns to decrease. However, the crude oil price and gold index are insignificant. ese findings are similar to the results reported by Toparlı et al. [55] in the context of Turkey using the time-varying parameter vector autoregressive approach. For comparative analysis, we also report results of estimated coefficients based on OLS (Ordinary least square). All the coefficients are mostly negative and significant. However, the SLP model outperforms the OLS because most of the coefficients are highly significant, unlike the OLS.
In the second experimental setting, we used equation (2) to investigate the influence of the gold index, crude oil price, interest rate, exchange rate, and the additional variable of the sentiment of economic news on stock returns for the Turkish stock market. Table 9 displays the results for this experimental setting. e columns in Table 9 indicate the coefficients from c°to c5, including the sentiment variable. e rows list the values of the top five firms in Turkey, as given in the previous experimental setting. Our findings suggest that the gold index, interest rate, and exchange rate have highly significant and negative influences. All the coefficients of these variables are  Complexity 9 negatively significant at the 1% level. An increase in the price of the gold index becomes attractive for investors, which negatively influences stock returns. Any positive shock in the exchange rate causes the stocks' returns to increase. e coefficient of EUNS is highly significant and negative, indicating that any economic uncertainty news negatively influences stock returns during the period leading up to the fiscal budget release. For comparative analysis, we also report results of estimated coefficients based on OLS (ordinary least square). All the coefficients are mostly negative and significant. However, the SLP model outperforms the OLS because most of the coefficients are highly significant, unlike the OLS.
In the last experiment, we estimated the values of coefficients for Hong Kong. is experiment was also divided into two scenarios. In the first, we used (1) to investigate the influence of the gold index, crude oil price, interest rate, and exchange rate on stock returns in the Hong Kong stock market without involving the sentiment variable. To accomplish this, we used the stock returns of the top five performing companies alongside the Hong Kong stock exchange index. Table 10 presents the results of this experimental scenario. e columns in Table 10 display the values of the coefficients, and the rows indicate the top three companies in    5098. ese findings suggest that the crude oil price, interest rate, and exchange rate are highly significant and negatively influenced. All coefficients of these variables are negatively significant at either the 5% or 1% significance levels. Any positive shock in the exchange rate causes the stocks' returns to increase. ese results are similar to those of Khan et al. [56], who reported that the oil price negatively influences stock returns in the short and long run. For comparative analysis, we also report results of estimated coefficients based on OLS (ordinary least square). All the coefficients are mostly negative and significant. However, the SLP model outperforms the OLS because most of the coefficients are highly significant, unlike the OLS.
In the next scenario, we employ equation (2) to investigate the influence of the gold index, crude oil price, interest rate, and exchange rate by including the sentiment of economic news on stock returns in the Hong Kong stock market. Table 11 provides the results of this scenario for Hong Kong. e effects of the gold index, interest rate, and exchange rate are highly significant and negative. All the coefficients of these variables are negatively significant at the 1% level. Any positive shock in the exchange rate increases the stock returns. e coefficient of social media sentiment toward economic news is highly significant and negative. us, during the period of a fiscal budget announcement, any economic uncertainty news negatively affects stock returns. For comparative analysis, we also report results of estimated coefficients based on OLS (ordinary least square). All the coefficients are mostly negative and significant. However, the SLP model outperforms the OLS because most of the coefficients are highly significant, unlike the OLS.

Results of Predictions with Macroeconomic Factors and without Sentiment.
In this section, we analyze the performance of the proposed model in terms of predicting the returns of different companies in the US, Turkey, and Hong Kong. In the first step, we tested the models using macroeconomic factors without including sentiment. We trained the single-layer perceptron model using macroeconomic variables such as the exchange rate, interest rate, gold index, and oil price across 50 epochs. In regression, these variables are regarded as dependent variables, whereas the target variable is the returns of various companies. e parameters of a single-layer perceptron include the weight optimizer, which is Adam; the loss function is "Mean Squared Error," and the batch size is 4. e input layer of a single-layer neural network consists of units equal to dependent variables, while the last consists of one unit (neuron) representing the output value. Figure 3 depicts the MSE loss during single-layer neural network training for enterprises from all nations. e first graph illustrates the training loss on the data of all Hong Kong companies, whereas the second graph depicts loss curves on US companies, and the third graph depicts curves on Turkish companies. e graphs show that a single-layer neural network converges quite smoothly and with near-zero error.
In addition, we have computed the values of RMSE (root mean square error), MAE (mean absolute error), and MSE (mean squared error) to evaluate the robustness or performance of single-layer perceptrons and the OLS method. Table 12 shows the values of RMSE, MSE, and MAE for companies in Hong Kong, the US, and Turkey with singlelayer perceptron. Each part of Table 12 shows the results of different companies. ese scores are computed by using the actual and predicted values of returns. It is observed from Table 12 that values of RMSE, MSE, and MAE are quite low, which is an indication of best performance.
However, AK Bank of Turkey's RMSE score is slightly higher when compared to companies from other countries. In addition, for comparison, we repeated the same experiments using the OLS method as shown in Table 13. It is observed from Table 13 that the values of RMSE, MSE,   and MAE with the OLS technique are generally the same as with the SLP method. However, for certain companies, the values of error with the OLS approach are higher than with the SLP approach, which demonstrates the feasibility of ANN-based approaches. Furthermore, the SLP is currently based on single-layer, but performance improves when the depth is increased to multi-layers to capture more information from features. e smallest loss values also reflect another realisable value: that predictions become more accurate when macroeconomic factors are considered.

Results of Predictions with Macroeconomic Factors and
Sentiment. We evaluated the model's performance in the second stage by including both sentiments and macroeconomic factors. In this experimental setting, the variables of linear regression include the exchange rate, interest rate, gold index, crude oil prices, and sentiment variable. We trained the single-layer perceptron model with these variables for 50 epochs and performed the task of prediction. All of these experiments are repeated with firms from other countries. e training loss curves of different experiments are depicted in Figure 4.  e rst graph shows the loss curves of Hong Kong companies, the second graph shows the results of Turkey's companies, and the last graph shows the loss curves of the United Nation's companies. Graphs show that SLP models converge relatively rapidly and loss values reach zero. In addition, the results in the form of RMSE, MSE, and MAE of SLP models with the companies of all countries are also computed as given in Table 14. Table 14 contains the ndings of companies from various countries. ese results are computed by combining actual and predicted return values. Table 14 shows that the values of RMSE, MSE, and MAE are relatively low, indicating excellent performance. As shown in Table 15, we also assessed and extracted the performance of both macroeconomic factors and sentiments using the standard linear regression approach. It has been noticed that the error values with SLP employing sentiments are better than the OLS approach; for example, the MSE value of SLP is 1.10, while the MSE value of OLS is 1.26, which is more than SLP. As a result, it is logically stated that macroeconomic factors and sentiments have a signi cant e ect on returns.

Discussion and Comparisons
Stock market forecasting and analyzing stock returns under di erent factors comprise a developing eld in nancial research. For corporate organizations, the stock market is an economic driver that mobilizes assets and provides investment opportunities for investors at various levels, such as national, international, and institutional levels, and those who desire to increase their pro ts without incurring losses. Researchers have employed historical data on stocks in existing research studies to perform stock market analyses or forecasting tasks [17]. However, some research studies have involved the sentiment data for particular events on social media platforms with stock data to more accurately model stock market trends [19][20][21] because data analytics based on social media plays an important role in countries' stock market trends. All these analyses have been conducted through diverse approaches, of which ANNs and traditional intelligence-based models are the most prevalent. In recent years, the use of stock forecasting models based on artificial intelligence, particularly deep learning algorithms, has grown. Nevertheless, some regression-based machine learning models have also been employed, such as support vector regression. Nonetheless, finding the most optimal methods is a critical field of study.
In the same vein, stock markets reflect a country's economic health; thus, in order to properly assist investors and other shareholders, the effects of macroeconomic variables on stock market returns should be assessed. During stock investment decisions, the existence and unpredictability of macroeconomic factors guide investors with ideas about whether an investment will earn high or lower returns. Changes in macroeconomic variables can considerably influence stock market pricing, stimulating the interest of economists and investors. Hence, the involvement of macroeconomic variables in analyzing stock market trends benefits investors and policymakers because extensive knowledge permits investors to make more informed and wiser decisions. e influence of the relationship between macroeconomic factors and stock returns must be understood to more accurately model stock market trends and patterns. From this perspective, this study contributes to the  In previous studies, this influence has been studied and demonstrated through different statistical and traditional regression methods. However, compared to them, this study proposed a more refined and effective approach using singlelayer neural networks to carry out regression analyses. In addition, this study included the EUNS as an additional variable to macroeconomic variables to analyze the stock market returns more accurately.
Furthermore, we analyzed the stock returns of three well-established countries: the US, Turkey, and Hong Kong. Among these countries, we selected the top four or five biggest companies, for which we computed the values of the regression coefficients. e findings demonstrate that the gold index, interest rate, and exchange rate are extremely significant and negative for all these countries. In similar lines, EUNS is also negative and significant.

Conclusion
is study investigated the influence of macroeconomic variables (i.e., the gold index, crude oil price, interest rate, and exchange rate) in the context of EUNS on stock market returns. For the empirical process, we used the daily data for all these variables for a specific set of countries: the US, Turkey, and Hong Kong. Later, we employed single-layer neural networks and ordinary least-square regression to calculate the regression coefficients. e results reveal that the gold index, interest rate, and exchange rate are highly significant and negative for all these countries. Moreover, EUNS is also significant and negative in estimating stock returns. We calculated EUNS only for the period of fiscal budget announcements for the US, Turkey, and Hong Kong. As EUNS is negatively significant, it causes panic in stock market participants, which may ultimately lead investors to withdraw their investments. erefore, regarding the policy implications of this study, it is important to control negative news about the economy that can panic investors during sensitive periods. Similarly, individual investors should have portfolios that include gold and stocks during uncertain periods to avoid abnormal losses. In our future research studies, we intend to expand the dataset on EUN tweets to cover a longer period. Furthermore, data regarding the other macroeconomic variables can also be enhanced.
Data Availability e datasets are publicly available and will be provided by contacting the corresponding author.

Conflicts of Interest
e authors declare no conflicts of interest.