Visualizing How the Leading Macroeconomic Indicators Track US GDP

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 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 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans 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 boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis 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 seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI