Carlo Altavilla, Raffaella Giacomini, and Giuseppe Ragusa, "Anchoring the Yield Curve Using Survey Expectations", Journal of Applied Econometrics, Vol. 32, No. 6, 2017, pp. 1055-1068. ## Data The yields data are pooled from two sources. The three-month yield is from the Fed's H-15 release. The one used is from the FRED data repository (code [DGS3MO] (https://fred.stlouisfed.org/series/DGS3MO)). For longer maturities, we use zero-coupon yields constructed in Gurkaynak and Wright (2007). The excel spreadsheet containing the data can be obtained [here] (https://www.federalreserve.gov/econresdata/researchdata/feds200628.xls). We focus on average-of-the-month data from January 1985 to December 2011. We consider yields of the following 17 maturities (in months): 3, 6, 9, 12, 15, 18, 21, 24, 30, 36, 48, 60, 72, 84, 96, 108, 120. This choice provides us with a panel of 324 monthly observations on 17 different yields. For convenience, we provide csv files with the data for both the Gurkaynak and Wright yields and the 3-month Treasury yields obtained from FRED in the files DGS3MO.csv and feds200628.csv, respectively. These files are ASCII files in DOS format. They are zipped in the file agr-data.zip. Unix/Linux users should use "unzip -a". The macroeconomic variables used in the macro-augmented DNS model consist of monthly observations on 23 U.S. macroeconomic time series from 1985:1 through 2011:12. Table 2 of the online appendix describes the data and the transformations applied to each individual series. These data are in the file dataset_factors_data.csv, which is also in agr-data.zip. Data on yield expectations are from the Blue Chip Financial Indicators. Data on the Blue Chip monthly expectation are proprietary; hence the data cannot be lodged here. The data can be acquired by [Wolters Kluwer] (https://lrus.wolterskluwer.com/store/products/blue-chip-financial-forecasts-prod-000000000010041429/journal-item-1-000000000010041429). Data on expectation were not available electronically and thus manual scraping was necessary. ## Replication code The zip file `agr-anchoring.zip` contains all the data (except the Blue Chip data) and the code needed to replicate figures and tables reported in the paper and the online appendix. The code is written in `R`. Several R packages are used, but the code will automatically install them provided the package `pacman` is installed (see instructions below). Note that the files in agr-anchoring.zip are *not* in DOS format, and some of them are binary. The data directory contains Unix versions of the three csv files. Once unzipped, agr-anchoring.zip creates a tree with several directories: R 00-kalman.R 01-helper.R 02-load_data.R 03-setup_model.R Rmd figures functions.R header.tex kalman-tikzDictionary kalman.Rmd kalman.md kalman.pdf latex.R tables data DGS3MO.RData DGS3MO.csv dataset_factors_data.csv feds200628.csv results dns_kalman.Rda 6 directories, 17 files The code is in the `replication/R` folder. The main program file is `00-kalman.R`, which once executed calls `01-helper.R`, `02-load_data.R`, and `03-setup_model.R`. `00-kalman.R` generates a R data file, `dns_model.RData`, in `replication/results/`. This file contains all the models estimated. The tables and figures in the paper in the online appendix are obtained by "knitting" the rmarkdown file `kalman.Rmd`, which uses the information in `dns_model.RData` and yield and survey data files descibed above. The following instructions can be used to produce `dns_model.RData`: unzip agr-anchoring.zip cd replication/R ## Install pacman package R -e 'options(repos = c(CRAN = "http://cran.rstudio.com")); install.packages("pacman")' ## Run the code R -e 'source("00-kalman.R")' The following commands produce `replication/Rmd/kalman.pdf` cd replication/Rmd ## Knitr kalman.rmd R -e 'library(knitr); knit2pdf("kalman.Rmd")' This last step produces a pdf file, `results/kalman.pdf` containing the tables and figures reported in the paper and in the online appendix. A pdf file generated on March 23, 2017 is included in the replication material.