stock.prices Import S&P500 since 1999.economic.data Import real U.S. GDP growth since 2000.stock.prices
economic.data
Merge
Plot
stock.prices Import S&P500 since 1999.Hint: Google tidyquant::tq_get() to find example codes.
Hint: Calculate yearly returns; create a new variable, year; and drop date.
economic.data Import real U.S. GDP growth since 2000.Hint: Find the symbol in FRED. Select in the list of related variables, Percent Change from Preceding Period, Annual, Not Seasonally Adjusted.
Hint: Create a new variable, year; convert price to decimal number; and drop date.
Hint: Google dplyr::left_join() to find example codes.
Hint: See the code in 4.2.1 Scatterplot in the textbook.
There is a relatively strong, positive correlation between stock markets and economic growth. While stock prices can indicate economic growth a year prior, it is not always accurate. However, it is a very reliable indicator.