Visualizing How the Leading Macroeconomic Indicators Track US GDP

Fan(Jacky) Zhang
Posted on Jul 18, 2018


There are many economic indicators release every month. People are often confused by popular medias that they are told certain indicators are important than others. However, what type of economic indicators will make real impact on US economy and what indicators that we should really care about? With the rising concern, I created an interactive dashboard that provides interface to visualize the indicators called "Leading Macroeconomic Indicators" to track US economy. Furthermore, I will use the indicators to predict US GDP growth as well as stock market returns. This dashboard is implemented using Shiny in conjunction with dyGraph library.



The information about the datasets:

  1. The Institute for Supply Management ISM Manufacturing Report On Business , Purchase Manager Index (PMI)
  2. The Institute for Supply Management ISM Non-Manufacturing Report On Business , NMI (aka Service PMI)
  3. US Housing Starts
  4. The University of Michigan Consumer Sentiment Index (UMCSI)
  5. US Real GDP
  6. S&P 500 Market Index

There are private and public sectors in economy as the whole. Within the private sector, there are business and consumers. In the business, there are also manufacturing and services. PMI and NMI represent manufacturing and services, the Housing Starts reflects US housing market and also it can be a test as the liquidity in banking sector. Because when consumers buy the residential properties, they do not purchase with 100% cash. Instead, they use sort of the hybrid way where cash + mortgage. In the other way, it is the willingness of the bank to lend the loan. UMCSI represents the consumer confidence. If consumers do not have confidence about their future aspects, then they will save more and consume less now that results future GDP contracts, and vice versa. The pictures below show the introduction page and in-depth about each indicators:



The application has multiple tabs, each one offering a multiple index comparisons. In the correlation analysis tab, it allows us to compare with all indexes between each other. You can also choose any single index to compare with GDP, market index or any other combinations. Also the corresponding data information for all indexes can be found by clicking on the Data tab.

When you compare GDP with the leading indicators such like PMI, NMI. You can see there is a very clear trend that the leading indicators and GDP, they both go to the same direction. And the GDP definitely follows leading indicators.

Leveraging dyGraph charting library, we can select the time period by using Range Selector on the bottom of the graph. When we visualize the long-term trends between the major market indicator such as SP500 and US Real GDP growth, it is plotted within the chart to see the relative performance. We can see that the stock market return is really driven by a country's income.



What is the intuition? How to really interpret it and get the benefit from it? Let's create a binary situation where 0 = either GDP or S&P 500 falls, 1 = either GDP or S&P 500 rises. With the conditions, I have created 4 situations listed below:

Historically, GDP explains 62% of S&P500 moves. When it doesn't, the majority of the time it's because the S&P500 moves down when GDP doesn't go down i.e. Profit taking?

Only 8% of the time since 1950 has the S&P500 moved up and GDP has gone down.

In statistic, if we can predict GDP (Funadamental) and take profits at the right times (Technical), we will be right 92% of the time.

As you can see, leading indicators really have impact on US economy as a whole, and it influences the stock market return as well. Therefore, this app is very flexible and generic in a sense that analysis on the correlations in US economy.



1. Institute for Supply Management: ISM
2. ISM Report on Business Article
3. Econimic Research, Federal Reserve Bank of St. Louis
4. University of Michigan, Survey of Consumers Research Center
5. United States Census Bureau

6. Code in GitHub


About Author

Fan(Jacky) Zhang

Fan(Jacky) Zhang

Fan received a Bachelor's degree in Economics from University of California, San Diego. Fan comes from an athlete’s background as a professional badminton player on Chinese National Badminton Team. Consequently, He never received a formal education until He...
View all posts by Fan(Jacky) Zhang >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp