In this tutorial, you will learn
- to download macroeconomic data
- assess the collection methods and the quality of the data
- write computer code to wrangle and analyse data
Exercise 3A: Survey of Professional forecasters
Download the individual responses for the Survey of Processional forecasters for U.S. nominal gross domestic product. The Survey of Processional forecasters can be found here: https://www.philadelphiafed.org/research-and-data/real-time-center/survey-of-professional-forecasters
- Select “Download one variable at a time”
- Select “Nominal Gross National Product/Gross Domestic Product (NGDP)”. Note that you can find “Documentation.pdf” here.
- Select “Individual Responses”
- This will download the file “Individual_NGDP.xlsx”
Use the lecture materials and the Survey documentation to answer the following questions:
- What is the source for the real-time historical values for nominal gross domestic product?
- Explain the difference between the data prior to 1992, and after 1992.
- Why is the data for nominal gross domestic product seasonally adjusted?
- Is nominal gross domestic product a stock or a flow variable?
- Discuss whether nominal gross domestic product is a good measure for growth of production.
- Consider the forecasts for nominal gross domestic product for the first quarter of 2005. What was the deadline date for submitting the forecasts?
Use the downloaded file “Individual_NGDP.xlsx” to answer the following questions:
- Put the downloaded file in your working directory and use read_excel to load the data in your workspace
spf <- read_excel(???,sheet=1)
- Select the forecasts (nowcasts) for nominal gross domestic product for the first quarter of 2005.
spf2005Q1for <- spf %>% filter(YEAR==???,QUARTER==???) %>%
select(???,???) %>% drop_na()
- What is the mean forecast for the first quarter of 2005?
- Who is the most optimistic forecaster?
Exercise 3B: Real-time data vintages
Use the ALFRED package to access the ALFRED database. Download all the vintages for the nominal gross domestic product in the first quarter of 2005.
fred2005Q1vin <- as_tibble(get_alfred_series(???,
observation_start = ???,
observation_end = ???,
realtime_start = ???,
realtime_end = ???))
- What is the source of the ALFRED nominal gross domestic product data?
- Provide the license of the ALFRED data.
- What is the earliest vintage in ALFRED after the survey submission of the Survey of Professional Forecasters?
- Plot the values for nominal gross domestic product in the different vintages over time.
fred2005Q1vin %>% ggplot(aes(y=???,x=???))+geom_line()
- How can the observed pattern be explained?