Question: choose a data set For this assignment you need to write code in R. In addition, I would like you to also generate a report
For this assignment you need to write code in R. In addition, I would like you to also generate a report in R Markdown. Please submit the R code such that I can run it on my computer without any error messages or warnings. This means there should be no static file references. In addition, submit the R Markdown files as well as the output of it in whatever format you happen to select. Essentially, the R script alone is not sufficient. All the submitted files should have your names on them. The names should also be in the file name. In this assignment, we would like to use the slope of a yield curve measured by the difference of long-term and short-term interest rates to predict real GDP growth in the US. You can read more on the yield curve here Broadly, your work should follow this outline: 1. Read in real GDP growth for the US. Choose a measure of spread. It could be the difference between a 10-Year Treasury Bond yield and a 2-Year Treasury Bond yield or some other measure. Take the longest possible sample and plot the data. 2. Write a simple linear regression model. Summarize the output of the regression both in statistical as well as economic terms. Be careful about the units of measure. 3. Comment on the in-sample fit. Plot the fitted values against the actual realizations of the real GDP growth. 4. If you were to use a model that was estimated roughly ten years ago, how well would it do in forecasting? How well would a sample mean do in forecasting real GDP growth in the past 10 years? 5. Given the setup in the previous point, if you have to evaluate the models up until the end of 2019, what would you say? Would the model prediction be better than the prediction with a sample mean? Explain For this assignment you need to write code in R. In addition, I would like you to also generate a report in R Markdown. Please submit the R code such that I can run it on my computer without any error messages or warnings. This means there should be no static file references. In addition, submit the R Markdown files as well as the output of it in whatever format you happen to select. Essentially, the R script alone is not sufficient. All the submitted files should have your names on them. The names should also be in the file name. In this assignment, we would like to use the slope of a yield curve measured by the difference of long-term and short-term interest rates to predict real GDP growth in the US. You can read more on the yield curve here Broadly, your work should follow this outline: 1. Read in real GDP growth for the US. Choose a measure of spread. It could be the difference between a 10-Year Treasury Bond yield and a 2-Year Treasury Bond yield or some other measure. Take the longest possible sample and plot the data. 2. Write a simple linear regression model. Summarize the output of the regression both in statistical as well as economic terms. Be careful about the units of measure. 3. Comment on the in-sample fit. Plot the fitted values against the actual realizations of the real GDP growth. 4. If you were to use a model that was estimated roughly ten years ago, how well would it do in forecasting? How well would a sample mean do in forecasting real GDP growth in the past 10 years? 5. Given the setup in the previous point, if you have to evaluate the models up until the end of 2019, what would you say? Would the model prediction be better than the prediction with a sample mean? Explain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
