Description of
Dataset
The dataset sourced from Yahoo Finance via two APIs: Yahoo Financer
and Quantmod. The data encapsulates a diverse array of financial
information spanning indices, exchange rates, and investment volumes
across various markets and timeframes. It comprises meticulously curated
data, encompassing indices such as the S&P 500 (^GSPC), NASDAQ
(^IXIC), and Dow Jones Industrial Average (^DJI), reflecting the
performance of key stocks within the US market. These indices serve as
crucial barometers, influencing global investor sentiment and market
trends.
Additionally, the dataset incorporates exchange rates, delineating
the relative value between currencies, including widely traded pairs
like USD/EUR, USD/JPY, and USD/CAD. These exchange rates signify the
comparative worth of one currency against another, pivotal in
understanding international trade dynamics and economic health.
Moreover, the dataset intricately captures investment volumes,
elucidating the magnitude of trading activities within specific markets,
commodities, or stocks. These volumes indicate the extent of market
liquidity and investor participation, offering insights into market
trends, stock movements, and trading patterns.
Overall, this comprehensive dataset amalgamates key financial
indicators, facilitating in-depth analyses, trend evaluations, and the
exploration of correlations between indices, exchange rates, and
investment volumes. Its breadth and granularity provide a valuable
resource for understanding and forecasting market movements and global
economic dynamics.
We use the following broad categories of data:
Exchange Rates: This includes data from yahoofinancer about exchange
rates and their relative changes over time. We grab this data in two
sections, one analyzing exchange rates directly, the other when looking
at them in comparison to CCI data CEIC data: This data was a companion
to yahoo finance, since yahoo finance does not have easy access to the
Consumer Confidence Index. This is a single column data, CCI, that is
calculated monthly, and repeated to cover the entire month. Major
Indexes: This data was across multiple indexes, such as gold, oil, the
Dow Jones, and were used to identify trends in a country’s spending and
usage.
Research Questions
With our analysis we hope to analyze some of the following
questions:
Question 1:
- How does the United States Dollar (USD) hold up against the
currencies of some other foreign countries and does this correlate with
their economic standing?
Question 2:
- How have different facets of the United States economy performed
when compared to each other and also against other countries? Are there
any identifiable patterns that arise?
Question 3:
- How does investor behavior change or how is it affected by the
performance of various components of a country’s economy/market?
Analysis of Exchange
Rates of Various Currencies.
The foreign exchange market is incredibly important for international
trade. Our first question was, what affects currency exchange rates, and
how? To answer this question, analyzed trends in exchange the rates from
various currencies to the US Dollar over the past 6 years. We aimed to
analyze the most internationally traded currencies from each continent,
but had to make a few replacements. Since we were comparing exchange
rates to the US Dollar, we of course couldn’t use the US Dollar, so
instead we went with the next most traded currency from North America,
which is the Mexican Peso. From South America we also went with the
second most traded currency, the Chilean Peso, as the Brazilian Peso had
some missing data that was being problematic in our analysis. Finally we
also went with the second most traded currency from Europe, the Great
British Pound, for the sake of the last part of this section, as the
Euro has been adopted by multiple countries since the start of our
analysis. So our full list of currencies is: Great British Pound (GBP),
Japanese Yen (JPY), Australian Dollar (AUD), Mexican Peso (MXN), South
African Rand (ZAR), and the Chilean Peso (CLP).
Analysis via Time
Series
There are two time series plots below. The first displays normalized
exchange rates from each currency to the US Dollar over time, and the
second displays the growth rate in these exchange rates by month. We
normalized each currency’s exchange rates in the first plot by dividing
by the mean value in order to allow us to meaningfully compare them, as
the proportional change, and not the exact value, is ultimately what
matters for our purposes.

There are many interesting observations we make from these graphs.
First, it seems that most currencies chosen often follow similar trends
of when they’re becoming weaker or stronger compared to the US Dollar,
which perhaps makes sense given that the US Dollar is internationally
traded much more than the others (specifically over 5 times more volume
than the Yen, which is the most traded currency in the graph).
With the exception of the Mexican Peso, every currency has weakened
with respect to the US Dollar over this time period, albeit some more
than others. It’s not surprising that there is a sharp drop in early
2020 in most of the exchange rates, as this is when the COVID-19
epidemic hit globally, however it is interesting that the Japanese Yen
didn’t follow this trend, and instead enjoyed slow steady growth over
that time period. The plot of normalized exchange rates shows various
periods in the data, ranging from semi-regular, typically smaller
few-month fluctuations to stronger upward or downward trends over the
course of a few years. The exchange rate growth plot suggests more
regular fluctuations over the course of a few months. To better examine
that last point we use a seasonal decomposition plot, displaying just
the decomposition of our data for the Great British Pound and the
Japanese Yen:

The plot above confirms what we observed in the previous paragraph:
the ‘seasonal’ plot suggests that there are regular quarterly periods in
the data, however these are largely obscured by random
irregularities.
Analysis via PCA
We then performed Principal Component Analysis on our data. For each
currency, we tracked an ETF following the country that uses that
currency, as well as an ETF tracking the US, and looked at the changes
in both market value and volume traded. We looked at changes over the
course of a month. Our variables are FUND_PERCENT_CHANGE which
represents the change the value country’s given fund over month,
FUND_VOL_CHANGE which represents the change in traded volume of
country’s given fund, and US_PERCENT_CHANGE and US_VOL_CHANGE, which
track the same data but for the ETF that tracks the US. Of course we
also include the change in exchange rate, PERCENT_CHANGE. The results of
our PCA are below:
## Importance of components:
## PC1 PC2 PC3 PC4 PC5
## Standard deviation 1.4954 1.0407 0.9956 0.68142 0.47469
## Proportion of Variance 0.4472 0.2166 0.1982 0.09287 0.04507
## Cumulative Proportion 0.4472 0.6638 0.8621 0.95493 1.00000
Above we see that the first two principal components explain 66.42%
of the total variance. We visualize our PCA with the biplot below,
comparing our variables and their effects on the first and second
principal components.

From the biplot, we can see that that increases in the price and the
traded volume of the funds for the selected countries and the US have
very similar correlations with the first and second principal
components. Increases in market value and in volume traded are both
correlated with a very similar moderate rise in the second principal
component, and have opposite correlation with the first principal
component. We also see that the changes in exchange rate are negatively
correlated with the second principal component, and has very little
association with the second principal component. Overall from this
biplot we observe that given an increase in the market value of an ETF
tracking a given country, we’d expect to see a weakening in that
nation’s currency compared to the US Dollar. We’d expect similar results
given an increase in volume traded, or in either of those quantities for
the given US fund.
One potential weakness in this analysis is that the funds we are
tracking above are traded on the US-market and as such aren’t
necessarily the most accurate measures of a given nation’s economic
strength, as they look at this from a rather US-centered view. This also
likely contributes to the fact that changes in the funds’ market value
and volume have nearly identical associations with PC1 and PC2 compared
to the US fund. Thus if we were to use other data such as a given
nation’s GDP, or other commonly used measures of economic strength, we
may be able to draw more meaningful and less biased conclusions with
respect to the effects on exchange rates.
Analysis of Major
Indices of Various Countries
In this section we want to analyze various indices and commodities
within the United States and compare their performance to the FTSE 100
and the Nikkei 225, an index on the British exchange and one on the
Japanese exchange, respectively. In doing so we wish to compare and
contrast the performance and patterns of the United States economy
versus some other countries. We simultaneously also wish to analyze the
performance of different investment options within the United States
economy to rank them in terms of growth, consistency, and some other
useful metrics that can be handy when investing.
For instance, before conducting our analysis, our group hypothesizes
that commodities such as oil and gold will be capable of withstanding
financial crises such as the 2008 Housing Market crash and the COVID-19
pandemic better than an index fund such as the S&P 500.
Analysis via Time
Series
To begin our analysis, we first selected the following indices:
S&P 500, Dow Jones Index, NASDAQ, US Crude Oil, US Gold, US 10-Yr
Bonds, FTSE 100, and the Nikkei 225. From there, we extracted the
monthly prices and volumes for each and calculated the percent change at
every month.
Our first two graphs display two time series: one of the normalized
closing price and the other of the % change since the initial price for
each index/commodity.

Upon, comparing the slopes of each, we determine that the Japanese
economy experienced a boom in the late 1980s that exceeded the American
economy. On the other hand, while the American and British economies
boomed in the 90s, the Japanese economy seemed to fall into a recession
as evidenced by the downward slope of the Nikkei 225.
Before we continue with our analysis, one major limitation that we
must consider is that using a singular index to model an entire
country’s economy may not be an accurate representation. It may be the
case that there is a strong correlation, but without more data for the
Japanese and British economies, our analysis cannot guarantee accuracy
and is more of a decently correlated speculation.

##
## Call:
## lm(formula = PERCENT_CHANGE ~ DATE * INDEX, data = indicesMonthly)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1160.78 -58.33 -4.83 55.78 2600.76
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.716e+02 5.779e+01 -11.621 < 2e-16 ***
## DATE 8.418e-07 4.674e-08 18.011 < 2e-16 ***
## INDEX^FTSE 5.522e+02 8.989e+01 6.142 1.02e-09 ***
## INDEX^GSPC -3.649e+02 8.949e+01 -4.077 4.78e-05 ***
## INDEX^IXIC -1.606e+03 8.937e+01 -17.968 < 2e-16 ***
## INDEX^N225 7.177e+02 8.989e+01 7.984 2.65e-15 ***
## INDEX^TNX 6.686e+02 8.989e+01 7.437 1.66e-13 ***
## INDEXCL=F 6.153e+02 1.239e+02 4.968 7.49e-07 ***
## INDEXGC=F -1.280e+02 1.239e+02 -1.033 0.302
## DATE:INDEX^FTSE -4.684e-07 7.600e-08 -6.163 9.00e-10 ***
## DATE:INDEX^GSPC 7.556e-07 7.556e-08 10.000 < 2e-16 ***
## DATE:INDEX^IXIC 2.314e-06 7.556e-08 30.631 < 2e-16 ***
## DATE:INDEX^N225 -8.424e-07 7.600e-08 -11.084 < 2e-16 ***
## DATE:INDEX^TNX -8.934e-07 7.600e-08 -11.754 < 2e-16 ***
## DATE:INDEXCL=F -7.181e-07 9.337e-08 -7.691 2.51e-14 ***
## DATE:INDEXGC=F -1.393e-08 9.337e-08 -0.149 0.881
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 265.9 on 1627 degrees of freedom
## Multiple R-squared: 0.8017, Adjusted R-squared: 0.7998
## F-statistic: 438.4 on 15 and 1627 DF, p-value: < 2.2e-16
Moving onto the facetted % change graphs, we notice that our highest
growth indices / commodities are the S&P 500 and NASDAQ which are
comprised of the top companies publicly traded within the US. This leads
us to believe that the top companies within the country vastly outpace
the general economy of the US. With that being said, the FTSE 100 and
Nikkei 225, which comprise of prominent companies in their respective
countries did not experience growth on the same level as the
aforementioned indices. This poses the question of whether the US
economy also outpaced the two other countries’ economies.
On another note, performing a linear regression on the various slopes
shows that there is a significant difference between the Dow Jones and
all the other indices / commodities other than gold. As of now we cannot
find a real reason for the two to have comparable percent changes other
than that the Dow Jones is one of the better gauges of the overarching
US economy, so perhaps gold prices tend to follow the overall pace of
the economy.
Analysis via Smoothed
Density Graphs
Our final analysis from this section centers on smoothed density
graphs of volume versus price.
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

For both axes we considered the log
of the inputs as to
normalize the differences between different indices/commodities and make
them easier to compare. After doing so we notice that American indices
tend to have a generally positive slope (seems to be increasing),
whereas the British and Japanese index slopes are harder to describe,
but seem to be decreasing. These slopes lead us to believe that American
investments are carried out with relatively similar behaviors or perhaps
by similar organizations or groups of people.
## `geom_smooth()` using method = 'loess'

We observe similar results when carrying out the same analysis on the
ETFs from different countries (mentioned in the currency section). In
fact, the US ETF exhibits similar behavior to what has been observed in
the previous graph, whereas the other countries tend to exhibit vastly
different behaviors from each other. On a surprising note, Mexico and
Australia appear to have similar slopes and thus their investor
behaviors seem to coincide. Such a result makes us curious about the
behaviors of investors across different countries and whether they
follow distinctive patterns! Unfortunately, our APIs do not give us
access to sufficient consumer data such that we can perform analysis on
investor behavior. Thus, we decided to find some data on consumer
preferences to analyze in conjunction with our economic data!
Analyzing Consumer
Confidence and Relation to Investment Volume
The motivation behind delving into the relationship between stock
trade volumes in various markets—such as the Australian (^AXJO), Mexican
(^MXX), and American (^GSPC) exchanges—and the Consumer Confidence Index
(CCI) lies in unraveling a vital piece of the economic puzzle:
understanding the intricate connections between investor behavior,
consumer sentiment, and their impact on international trade dynamics,
especially in the realm of currency exchanges.
The Consumer Confidence Index (CCI) serves as a pivotal gauge
reflecting public sentiment towards economic prospects. In tandem,
exchange rates represent the relative value of currencies in
international markets. Their correlation offers insights into how
consumer sentiment influences currency valuation and international
trade. CCI movements often impact consumer behaviors, altering
expenditure patterns, thereby affecting demand for imports and exports.
Understanding the interplay between CCI and exchange rates illuminates
the intricate relationship between consumer sentiment, currency
valuations, and global trade dynamics.
Consumer confidence acts as a powerful barometer of the public’s
outlook on economic prospects. When confidence is high, consumers tend
to exhibit greater willingness to spend, invest, and borrow. Conversely,
during periods of low confidence, consumer spending and investment
activities often contract. This sentiment doesn’t merely affect domestic
markets; it significantly influences how consumers engage in
international trade, particularly in purchasing goods from overseas.
The relationship between consumer confidence and international trade
becomes pivotal when we consider its implications for currency
exchanges. Strong consumer confidence tends to bolster domestic
consumption, leading to increased demand for imported goods and
services. This surge in demand often leads to greater imports, causing
outflows of the domestic currency to pay for these goods. Consequently,
this increased demand for foreign currencies can impact currency
exchange rates, potentially leading to depreciation of the domestic
currency against foreign currencies.
Conversely, when consumer confidence dwindles, consumers tend to rein
in their spending on imports, leading to decreased demand for foreign
goods. This reduction in imports can alleviate the demand for foreign
currencies, thereby impacting currency exchange rates differently,
potentially resulting in a stronger domestic currency relative to
foreign currencies.
Understanding the relationship between stock trade volumes, consumer
confidence, and its ripple effects on international trade dynamics,
including currency exchanges, becomes crucial for investors, businesses,
and policymakers alike. Changes in consumer sentiment can act as a
precursor to shifts in trade patterns, affecting not only domestic
markets but also exerting influence on global trade and currency
valuations.
By exploring the potential divergence between stock trade volumes and
the Consumer Confidence Index, we aim to decipher whether investor
behavior in these markets is predominantly driven by broader economic
factors or if it resonates more closely with the sentiments of
consumers. The outcomes of this analysis might offer insights into how
these markets respond to changes in consumer confidence and how such
responses might impact international trade patterns, influencing
currency exchange rates in the process.
## [1] "GSPC"
## [1] "MXX"
## [1] "AXJO"
Looking at the US,
Mexico, and Australia’s CCI

Comparing CCI and
exchange rates.
## [1] "USDMXN=X"
## [1] "USDAUD=X"
The US and
Australia

The US and
Mexico

The exploration of the relationship between the Consumer Confidence
Index (CCI) and investment metrics across diverse financial markets
reveals intriguing trends suggestive of a potential association. The
analysis conducted on the simulated CCI data and investment figures
indicates discernible patterns hinting at a plausible link between
consumer sentiment, mirrored in CCI fluctuations, and trends in
investment activities.
Across the financial landscape, there appears to be a generalized
inclination where fluctuations in CCI values seem to exhibit some level
of alignment with concurrent changes in investment patterns. Though the
exact nature and strength of this association remain abstract, the
trends observed suggest a potential interplay between consumer sentiment
and investment activities.
Within the domain of stocks, broad fluctuations in CCI levels appear
to, in some manner, shadow changes in trading volumes and overall market
activities. Similarly, trends hint at potential shifts in investment
sentiments across bond and commodity markets during periods of varying
CCI readings, indicating a possible correlation between consumer
confidence and investment figures across diverse market segments.
While these observations imply a semblance of synchronicity between
CCI trends and investment behaviors, the precise mechanisms underlying
this relationship remain elusive. The generalized trends observed across
financial markets tentatively point towards a potential interdependency
between consumer sentiment and investment decisions.
Meanwhile, the relationship between the Consumer Confidence Index
(CCI), exchange rates, and market behaviors in different countries
offers intriguing insights into the dynamics of international trade and
tourist expenditure.
In the context of Australia, where a lower CCI seems to coincide with
an improvement in the exchange rate concerning the US dollar, a
suggestive implication arises. This positive correlation hints at the
prominence of the US as a tourist destination rather than a major
importer. Lower CCI levels, indicating subdued domestic consumer
confidence, might coincide with an increase in tourist activity from the
US. Consequently, heightened tourist spending may contribute to an
increased demand for the local currency, improving the exchange
rate.
Conversely, the observed negative correlation between CCI and the
US-Mexico exchange rate suggests a contrasting scenario. In Mexico,
lower CCI levels seem to align with a weaker exchange rate against the
US dollar. This trend implies a scenario where the US, as a consumer
market, significantly contributes to the demand for Mexican goods and
services. A decline in US consumer confidence, mirrored in lower CCI
values, could potentially dampen demand for Mexican exports, leading to
a less favorable exchange rate.
This stark contrast in correlations highlights the nuanced roles that
tourism and consumer markets play in different economies. While
Australia appears to benefit from increased US tourist spending during
periods of lower domestic confidence, Mexico’s economy demonstrates
vulnerability to shifts in US consumer sentiment due to substantial
trade dependencies. These patterns underscore the multifaceted interplay
between economic indicators, consumer behaviors, and international trade
dynamics in distinct global contexts.
While the analysis presents suggestive trends hinting at a possible
association between Consumer Confidence Index levels and investment
metrics across diverse financial markets, the intricacies and nuances
defining this relationship warrant further exploration and in-depth
study.
Sector-based
Exploration within the US Economy
Our next question stems from the differences between various sectors
within the US economy. To conduct this analysis, we chose to explore the
differences between the Tech and Consumer industries by selecting dozens
of companies’ stocks within each category. After selecting the
appropriate stocks, we calculated their monthly percent change within
the last year. Then we performed some cleaning and scaling on the data
to construct the following dendogram:
Analysis Between
Sectors

The dendrogram depicting the monthly close differences between tech
and consumer stocks unveils intriguing insights into their market
behaviors. Primarily, it delineates distinct clusters where the purple
and light blue clusters predominantly encapsulate tech giants,
showcasing their collective market trends. These clusters likely
represent cohesive subsets within the tech sector, possibly hinting at
specific technological domains or market segments within the tech
industry. Conversely, the light brown cluster emerges as a distinct
entity mainly comprising consumer-oriented stocks, indicating a separate
trajectory in market performance compared to their tech counterparts.
Moreover, the presence of a balanced green cluster suggests a mix of
both tech and consumer stocks, potentially highlighting a group of
companies that exhibit similarities in market behaviors transcending
industry boundaries.
Sector Specific
Analysis
The next two dendograms aim to analyze the stocks within their
respective sectors by clustering together tech stocks and consumer
stocks. We then try to find patterns that emerge in these subsets.
## dend_tbl
## 1 2 3
## 57 25 7

## [1] 4.838325
## [1] 2.298264
The dendrogram reflects the comparative relationships among tech
stocks based on their monthly close differences. The average distance of
4.84 suggests a notable diversity in these stocks’ monthly performance
behaviors. This substantial average distance implies that, on average,
the stocks exhibit significant variability in their individual monthly
changes, indicating a wide spectrum of performance trends within the
tech sector during the observed period. However, within this diversity,
approximately 2.3% of the stocks are found within a distance of 2 units,
indicating a smaller subset that share closer similarities in their
monthly stock behavior. This subset might represent a cohesive cluster
of stocks displaying more synchronized or parallel trends. These closer
relationships might signify sectors or companies within the tech
industry that tend to move in unison or respond similarly to market
fluctuations, suggesting potential shared market influences or industry
dynamics impacting these specific stocks.

## [1] 4.406237
## [1] 6.812292
The dendrogram depicting monthly close differences among consumer
stocks illustrates interesting insights. With an average distance of
4.41, these stocks showcase a notable diversity in their monthly
performance behaviors, akin to the tech stocks analyzed earlier. This
suggests significant variability in individual monthly changes within
the consumer sector. However, the intriguing aspect lies in the
percentage of stocks within a distance of 2 units, which stands at
6.81%. Compared to the tech stocks’ subset within this proximity, the
consumer stocks show a higher percentage within this closer distance.
This implies a more substantial subset of consumer stocks exhibiting
relatively similar monthly behavior. This subgroup might represent a
more cohesive cluster within the consumer sector, indicating sectors or
companies that move more closely together in response to market dynamics
or shared industry influences. This higher percentage suggests a
potentially stronger interdependence or simultaneous response among
these consumer stocks, emphasizing a tighter association in their
monthly stock behavior.
Main Takeaways &
Future Directions
Main Takeaways
Our project took a deep dive into the world of financial data,
revealing intricate connections shaping the global economic landscape.
From dissecting exchange rates to scrutinizing major indices and
exploring investor behaviors, our analysis uncovered multifaceted
relationships influencing international trade dynamics and market
sentiments.
The examination of exchange rates provided insights into fluctuating
trends between the USD and select foreign currencies. While most
currencies showcased periodic weakening against the USD, exceptions like
the Japanese Yen displayed resilience during specific periods. However,
directly correlating these fluctuations with the economic standing of
nations requires a more holistic analysis integrating diverse economic
indicators.
Comparative analyses of major indices and commodities within the US
and across borders showcased diverse performances, especially during
critical events. Certain commodities exhibited resilience during crises,
while indices like S&P 500 and NASDAQ demonstrated distinct
movements. However, relying solely on single indices might oversimplify
the complexity of entire economies, highlighting the need for nuanced
datasets for comprehensive insights.
Exploring investor behaviors hinted at correlations between changes
in market value and traded volume of funds, influencing exchange rates.
Tracking ETFs of specific countries and the US revealed fluctuations in
market value aligning with currency strengths. However, this analysis
was derived from US-traded funds, potentially presenting a more
US-centric perspective. To grasp a holistic understanding of investor
behavior, integrating diverse economic indicators or GDP measurements
could offer deeper insights into exchange rates and broader economic
dynamics.
Future
Directions
Although our APIs allow us to stream in most of the data publicly
available on Yahoo Finance, it does not give us as much global economic
data nor consumer data as we would have liked. Additional information
within these realms could have allowed us to comprehend more about
trends in various countries’ economies and in investor behavior.
A potential future improvement would be to find more data on investor
behavior and conduct a deeper dive on Question 3, which could help us
find patterns in investor / organization behavior in reaction to various
stock market or economic conditions. Identifying and analyzing such
trends could help people make more informed decisions when investing and
also act more predictively about the stock market rather than
reactively.